添加插件firebasex之后,Ionic Cordova构建问题

时间:2020-11-02 20:07:00

标签: angular typescript cordova ionic-framework

打字稿中的离子,Angular Web应用程序。添加cordova-plugin-firebasex时会显示构建错误。

Package.json

"@capacitor/core": "2.2.1",
"@ionic-native/camera": "^5.29.0",
"@ionic-native/core": "^5.29.0",
"@ionic-native/fcm": "^5.29.0",

"cordova-android": "^9.0.0",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.1",
"cordova-plugin-camera": "^5.0.0",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-fcm-with-dependecy-updated": "^7.4.0",
"cordova-plugin-file": "^6.0.2",
"cordova-plugin-filepath": "^1.5.8",
"cordova-plugin-firebasex": "^11.0.3",
"cordova-plugin-ionic-keyboard": "^2.2.0",

tsconfig.json

  "experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es5",
"lib": [
  "es2018",
  "dom"
],
"resolveJsonModule": true

错误消息:

Updating resource files at platforms/android
Prepared android project successfully
Executing script found in plugin cordova-plugin-androidx-adapter for hook "after_prepare": plugins/cordova-plugin-androidx-adapter/apply.js
cordova-plugin-androidx-adapter: Processed 48 source files in 722ms
Executing script found in plugin cordova-plugin-androidx for hook "after_prepare": plugins/cordova-plugin-androidx/scripts/apply-to-gradle.properties.js
Executing script found in plugin cordova-plugin-fcm-with-dependecy-updated for hook "after_prepare": plugins/cordova-plugin-fcm-with-dependecy-updated/scripts/copy_google_service_files.js
Executing script found in plugin cordova-plugin-firebasex for hook "after_prepare": plugins/cordova-    plugin-firebasex/scripts/after_prepare.js
cordova-plugin-firebasex: Preparing Firebase on Android
No scripts found for hook "before_compile".
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=/home/devsec/Android/Sdk (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: /home/devsec/Android/Sdk
Subproject Path: CordovaLib
Subproject Path: app
Gradle Distribution URL: https://services.gradle.org/distributions/gradle-6.5-all.zip

> Task :app:processDebugManifest
/home/devsec/code/sources/alum/platforms/android/app/src/main/AndroidManifest.xml:27:9-34:50 Warning:
        activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was     tagged at AndroidManifest.xml:27 to replace other declarations but no other declaration present

> Task :app:compileDebugJavaWithJavac FAILED
/home/devsec/code/sources/alum/platforms/android/app/src/main/java/org/apache/cordova/firebase/FirebasePlugin.java:913: error: cannot find symbol
                    settings.put("developerModeEnabled",     remoteConfigInfo.getConfigSettings().isDeveloperModeEnabled());
                                                                                             ^
  symbol:   method isDeveloperModeEnabled()
  location: class FirebaseRemoteConfigSettings
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/devsec/code/sources/alum/platforms/android/app/src/main/java/org/apache/cordova/file/AssetFilesystem.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 11s
23 actionable tasks: 5 executed, 18 up-to-date
Command failed with exit code 1: /home/devsec/code/sources/alum/platforms/android/gradlew cdvBuildDebug -b /home/devsec/code/sources/alum/platforms/android/build.gradle
Error: Command failed with exit code 1: /home/devsec/code/sources/alum/platforms/android/gradlew cdvBuildDebug -b /home/devsec/code/sources/alum/platforms/android/build.gradle
    at makeError (/home/devsec/code/sources/alum/platforms/android/cordova/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/devsec/code/sources/alum/platforms/android/cordova/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[ERROR] An error occurred while running subprocess cordova.
    
        cordova build android --debug --verbose exited with exit code 1.
    
        Re-running this command with the --verbose flag may provide more information.
  ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
  ionic:utils-process onBeforeExit handler: running 2 functions +0ms
  ionic:utils-process processExit: exiting (exit code: 1) +14ms

有人熟悉吗? 我试图设置FCM,使用Angular,Firebase,Ionic推送通知。每当我添加cordovo-plugin-firebasex时,就会引发此构建错误。

我可以看到某处正在使用某种不赞成使用的函数。但是,如何抑制来自离子/科尔多瓦的错误或进行修复?

0 个答案:

没有答案