gpt4 book ai didi

java - 无法使用phonegap-plugin-push、cordova-plugin-crosswalk-webview 和 cordova-plugin-health 进行cordova android 构建

转载 作者:太空宇宙 更新时间:2023-11-04 12:55:11 28 4
gpt4 key购买 nike

操作系统:OSX 10.11 Cordova :5.4.1(也尝试过 6.0)节点:4.2.6使用的cordova插件:crosswalk-project/cordova-plugin-crosswalk-webview (1.5)、phonegap/phonegap-plugin-push (1.5.3) 和 dariosalvi78/cordova-plugin-health (0.5.3)

运行cordova build android时,我收到以下错误

  • What went wrong: Executi on failed for task ':dexArmv7Debug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: /usr/local/Cellar/android-sdk/24.4.1_1/build-tools/23.0.2/dx --dex --no-optimize --output /Users/simon/projects/SproutMobile/platforms/android/build/intermediates/dex/armv7/debug --input-list=/Users/simon/projects/SproutMobile/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/android/gms/internal/zzpz$zza;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:579)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:517)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:164)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:504)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)

*

手动应用 Multiple dex files define Lcom/google/android/gms/internal/zzau 中建议的修复到platforms/android/build.gradle没有改变任何东西。

任何帮助将不胜感激

最佳答案

使用phonegap/cordova构建后我遇到了类似的问题:com.android.dex.DexException:多个 dex 文件定义 Lcom/google/android/gms/internal/zzsk;

检查您的 build.gradle(module Android),如果您有 2 个库应该具有完全相同的版本但版本号不同。就我而言,它是 play-services-gms:8.4.0 和 play-services-location:9.2.1。

这是我更新的 build.gradle:

dependencies{
....
//make sure are both same version (8.4.0 or 9.2.1 in my case)
compile 'com.google.android.gms:play-services-gcm:9.2.1'
// this is the one I changed: compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-location:9.2.1' // it was 8.4.0
....
}

关于java - 无法使用phonegap-plugin-push、cordova-plugin-crosswalk-webview 和 cordova-plugin-health 进行cordova android 构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35463331/

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