简体   繁体   中英

"ionic cordova run android" not working with cordova-android@7.0.0

I updated my ionic project and now ionic cordova build android is no longer working. I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

This is my ionic info:

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v6.11.5
    npm               : 5.7.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\xxx\AppData\Local\Android\sdk

Misc:

    backend : pro

I have tried everything under the sun! Including:

  • updating ionic, android sdk, etc
  • deleting my entire project and re-installing it
  • removing all plugins and re-installing it
  • removing my android platform and re-installing it

nothing is working.

These are the plugins I have installed:

  • cordova-plugin-camera
  • cordova.plugins.diagnostic
  • cordova-plugin-device
  • cordova-plugin-facebook4
  • cordova-plugin-geolocation
  • cordova-plugin-inappbrowser
  • cordova-plugin-ionic-keyboard
  • cordova-plugin-ionic-webview
  • cordova-plugin-nativegeocoder
  • cordova-plugin-request-location-accuracy
  • cordova-plugin-splashscreen
  • cordova-plugin-whitelist

For anyone experiencing this issue, this was my problem. Turns out I had the cordova-plugin-facebook4 plugin, which was causing a problem. The solution I found was from https://github.com/jeduan/cordova-plugin-facebook4/issues/599

I had to edit this file /platforms/android/app/src/main/res/values/strings.xml by adding:

<string name="fb_app_id">facebook_id_here</string>
<string name="fb_app_name">facebook_app_name</string>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM