我正在为离子应用程序工作并尝试运行
ionic build android
检查:dexDebug
时,会抛出错误并且构建不完整。它给出的错误是:
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/opt/android-sdk/build-tools/23.0.1/dx --dex --no-optimize --output /home/deepak/projects/ionic/pajh_new/platforms/android/build/intermediates/dex/debug --input-list=/home/deepak/projects/ionic/pajh_new/platforms/android/build/intermediates/tmp/dex/debug/inputList.txt
错误代码: 2 输出:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/actions/ReserveIntents;
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:502)
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)
我找到了一个解决方案,它引发了两个依赖关系引用同一个类,并且依赖关系被添加到android平台文件的build.gradle但是我无法解决这个问题