无法使用 phonegap-plugin-push、cordova-plugin-crosswalk-webview 和 cordova-plugin-health 构建 cordova android
unable to make cordova android build with phonegap-plugin-push, cordova-plugin-crosswalk-webview, and cordova-plugin-health
os: OSX 10.11
科尔多瓦: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)
*
手动应用从 到 platforms/android/build 的建议修复。gradle 没有任何改变。
任何帮助将不胜感激
使用 phonegap/cordova 构建后我遇到了类似的问题:
com.android.dex.DexException:多个dex文件定义Lcom/google/android/gms/internal/zzsk;
检查您的 build.gradle(模块 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
....
}
os: OSX 10.11 科尔多瓦: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)
*
手动应用从
任何帮助将不胜感激
使用 phonegap/cordova 构建后我遇到了类似的问题: com.android.dex.DexException:多个dex文件定义Lcom/google/android/gms/internal/zzsk;
检查您的 build.gradle(模块 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
....
}