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

使用离子3构建android应用程序时出现processDebugResources错误,android,cordova,ionic-framework,gradle,ionic3,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:

我有一个基于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'.
> 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
                              ^
我试图在app/build.gradle中更改版本,但这对我没有多大帮助

我仍然相信有一些版本不匹配,因为一些更新。。。 当然,我会自己解决这个问题,但在我这么做的时候,也许你能给我一个很好的建议来解决这个问题

以下是完整的生成日志:

更新:我安装了一个名为
cordova android support gradle release
的插件,现在我发现以下错误:

Execution failed for task ':app:processDebugResources'.
> 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
                              ^
更新2:

我已经更新了我所有的东西,现在看起来像:

$ 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"
但我的构建仍然失败

以下是生成日志:

如果我使用
cordova-plugin-firebasex
plugin,我会体验到类似的行为

以下是生成日志:


注意:如果我卸载插件
cordova插件androidx
cordova插件firebasex
,则构建成功,但google play服务无法正常工作。

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

cordova插件firebasex

cordova插件androidx

cordova插件androidx适配器

感谢您的评论:

我当前的配置:

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"

您的项目中是否添加了firbase插件?是的,添加了firbase插件根本原因是由于更新了Firebase配置。删除插件后,该错误将不会出现,插件将帮助您解决问题。我使用推送通知和实时数据库,这就是为什么我使用firebase插件。如果我将删除插件,那么我将无法使用该功能。所以,我最终不明白如何解决这个问题。哪个插件可以帮我解决这个问题?
cordova-plugin-firebase
已经过时,调用firebase-API函数的时间比现在长。TL;DR:使用
cordova插件firebasex
,它是修复这些(和其他)问题的分支。有关更多详细信息,请参阅。我尝试了您的解决方案,但没有成功-控制台中出现错误:(节点:25578)未经处理的PromisejectionWarning:错误:eNot:没有这样的文件或目录,copyfile'/Users/apple/Desktop/klino/klino_user/plugins/cordova plugin firebasex/src/android/colors.xml'已经有5个了。还有另一种方法可以做到这一切。过来看。