gpt4 book ai didi

android - android平台上的cordova插件冲突

转载 作者:太空宇宙 更新时间:2023-11-03 13:54:42 25 4
gpt4 key购买 nike

每当我尝试构建我的 cordova 应用程序时,我都会收到此错误:

:mergeArmv7DebugAssets UP-TO-DATE :createXwalkCommandLineFileArmv7Debug :generateArmv7DebugResValues UP-TO-DATE :generateArmv7DebugResources UP-TO-DATE :mergeArmv7DebugResources :processArmv7DebugManifest :processArmv7DebugResources :generateArmv7DebugSources :compileArmv7DebugJava :preDexArmv7Debug :dexArmv7Debug

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)

:dexArmv7Debug FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':dexArmv7Debug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: /Users/sombriks/Library/Android/sdk/build-tools/22.0.1/dx --dex --no-optimize --output /Users/sombriks/git/g4l-taxi/platforms/android/build/intermediates/dex/armv7/debug --input-list=/Users/sombriks/git/g4l-taxi/platforms/android/build/intermediates/tmp/dex/armv7/debug/inputList.txt Error Code: 2 Output:

    UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode; at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596) at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554) at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535) at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171) at com.android.dx.merge.DexMerger.merge(DexMerger.java:189) at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303) at com.android.dx.command.dexer.Main.run(Main.java:246) at com.android.dx.command.dexer.Main.main(Main.java:215) at com.android.dx.command.Main.main(Main.java:106)

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 27.511 secs

/Users/sombriks/git/g4l-taxi/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^

Error code 1 for command: /Users/sombriks/git/g4l-taxi/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/sombriks/git/g4l-taxi/platforms/android/build.gradle,-Dorg.gradle.daemon=true ERROR building one of the platforms: Error: /Users/sombriks/git/g4l-taxi/platforms/android/cordova/build: Command failed with exit code 8 You may not have the required environment or OS to build this project Error: /Users/sombriks/git/g4l-taxi/platforms/android/cordova/build: Command failed with exit code 8

at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23) at ChildProcess.emit (events.js:98:17)

at maybeClose (child_process.js:756:16)

at Process.ChildProcess._handle.onexit (child_process.js:823:5)

[sombriks@eiko g4l-taxi]$

这是我的插件列表:

[sombriks@eiko g4l-taxi]$ cordova plugin list

cordova-plugin-admobpro 2.8.1 "AdMob Plugin Pro"

cordova-plugin-crosswalk-webview 1.2.0 "Crosswalk WebView Engine"

cordova-plugin-extension 1.1.4 "Cordova Plugin Extension"

cordova-plugin-googleplayservices 19.0.1 "Google Play Services for Android"

cordova-plugin-whitelist 1.0.0 "Whitelist"

org.apache.cordova.console 0.2.13 "Console"

只有android版本显示这个问题,ios版本编译运行。

一些other posts建议修改我的build.gradle,但目前没有效果。

如果有人遇到过这样的问题,请帮忙。

提前致谢。

编辑:

创建一个新项目并仅添加 crosswalk plugin给了我一个工作项目,包括 android 和 ios。我会添加更多插件,看看会发生什么。

最佳答案

cordova-plugin-googleplayservices 19.0.1 “Android 版 Google Play 服务”

删除此插件,它已被弃用,不再需要。

参见常见问题解答 3:https://github.com/floatinghotpot/cordova-admob-pro/wiki/Difference-of-Plugin-IDs

关于android - android平台上的cordova插件冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31305682/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com