使用Ionic 3构建android应用程序时出现processDebugResources错误

时间:2019-06-20 08:53:36

标签: android cordova ionic-framework gradle ionic3

我有一个基于Ionic v3构建的项目。 通常它可以正常工作,但是已经过去了一段时间,现在它引发了错误。

下面列出了当前配置:

ionic info

Ionic:

   Ionic CLI          : 5.0.3 (C:\Users\volkk\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.3

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : android 7.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.2, (and 16 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (C:\android)
   NodeJS            : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.7.0
   OS                : Windows 10

我遇到以下错误:

Execution failed for task ':app:processDebugResources'.

我试图更改app / build.gradle中的版本,但这并没有太大帮助。

由于某些更新,我仍然认为版本不匹配... 当然,我会尝试自己解决这个问题,但是当我这样做时,也许您可​​以就如何解决此问题给我一个很好的建议。

这是完整的构建日志:https://pastebin.com/zah1samG

更新:我已经安装了名为cordova-android-support-gradle-release的插件,现在出现以下错误:

> Task :CordovaLib:javaPreCompileDebug

Note: C:\Users\volkk\Downloads\Install\work\new\vagrant-php-box\sites\mobile application\platforms\android\CordovaLib\src\org\apache\cordova\engine\SystemCookieManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :CordovaLib:compileDebugJavaWithJavac

> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
> Task :app:javaPreCompileDebug
> Task :app:mainApkListPersistenceDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:createDebugCompatibleScreenManifests

> Task :app:processDebugManifest
C:\Users\volkk\Downloads\Install\work\new\vagrant-php-box\sites\mobile application\platforms\android\app\src\main\AndroidManifest.xml:24:9-31:50 Warning:
        activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present

> Task :app:processDebugResources

C:\Users\volkk\Downloads\Install\work\new\vagrant-php-box\sites\mobile application\platforms\android\app\src\main\java\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:6: error: cannot find symbol
import com.google.firebase.iid.FirebaseInstanceIdService;
> Task :app:compileDebugJavaWithJavac FAILED
                              ^

UPDATE2:

我已经更新了所有内容,现在看起来像这样:

$ ionic info

Ionic:

   Ionic CLI          : 5.0.3 (C:\Users\volkk\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : not installed
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.2, (and 18 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (C:\android)
   NodeJS            : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10

以下是已安装插件的列表:

$ ionic cordova plugins list
> cordova.cmd plugin ls

You have been opted out of telemetry. To change this, run: cordova telemetry on.
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-android-support-gradle-release 3.0.0 "cordova-android-support-gradle-release"
cordova-background-geolocation 2.12.3-beta.1 "BackgroundGeolocation"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-cocoapod-supportx 1.6.1 "Cordova CocoaPods Dependency Support"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-qrscanner 2.6.0 "QRScanner"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"

但是我的构建仍然失败。

以下是构建日志:https://pastebin.com/L7JDayfd

如果使用cordova-plugin-firebasex插件,我会遇到类似的行为。

以下是构建日志:https://pastebin.com/FRMuKqhv

$ ionic cordova plugins list
> cordova.cmd plugin ls

You have been opted out of telemetry. To change this, run: cordova telemetry on.
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-android-support-gradle-release 3.0.0 "cordova-android-support-gradle-release"
cordova-background-geolocation 2.12.3-beta.1 "BackgroundGeolocation"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-cocoapod-supportx 1.6.1 "Cordova CocoaPods Dependency Support"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-firebasex 2.0.7 "Google Firebase Plugin"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-qrscanner 2.6.0 "QRScanner"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"

P.S .:如果我卸载插件cordova-plugin-androidxcordova-plugin-firebasex,则构建成功,但是Google Play服务无法正常工作。

1 个答案:

答案 0 :(得分:1)

当我添加所有三个插件时,问题解决了。

cordova-plugin-firebasex

cordova-plugin-androidx

cordova-plugin-androidx-adapter

感谢评论: https://github.com/arnesson/cordova-plugin-firebase/issues/1081#issuecomment-503135862

我当前的配置:

ionic info

Ionic:

   Ionic CLI          : 5.0.3 (C:\Users\volkk\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.4

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 8.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.2, (and 19 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (C:\android)
   NodeJS            : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.9.0
   OS                : Windows 10


ionic cordova plugins list
> cordova.cmd plugin ls
com-sarriaroman-photoviewer 1.1.18 "PhotoViewer"
cordova-background-geolocation 2.12.3-beta.1 "BackgroundGeolocation"
cordova-plugin-androidx 1.0.2 "cordova-plugin-androidx"
cordova-plugin-androidx-adapter 1.1.0 "cordova-plugin-androidx-adapter"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-cocoapod-supportx 1.6.1 "Cordova CocoaPods Dependency Support"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-filepath 1.5.5 "cordova-plugin-filepath"
cordova-plugin-firebasex 2.1.0 "Google Firebase Plugin"
cordova-plugin-insomnia 4.3.0 "Insomnia (prevent screen sleep)"
cordova-plugin-ionic-keyboard 2.1.2 "cordova-plugin-ionic-keyboard"
cordova-plugin-qrscanner 3.0.1 "QRScanner"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.2.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"