突然间,我在Android Studio中的项目中出现以下错误。
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/android-4.4/dx --dex --output /Users/azamsharp/AndroidStudioProjects/SLB/app/build/dex/debug /Users/azamsharp/AndroidStudioProjects/SLB/app/build/classes/debug /Users/azamsharp/AndroidStudioProjects/SLB/app/build/dependency-cache/debug /Users/azamsharp/AndroidStudioProjects/SLB/app/build/pre-dexed/debug/android-async-http-1.4.4-ebbcd48910e41cec52d1452a5743c94a9159f5e1.jar /Users/azamsharp/AndroidStudioProjects/SLB/app/build/pre-dexed/debug/android-support-v4-6c3868a97cf3c20d5a1f7a32bd415e4ceb4d85e8.jar /Users/azamsharp/AndroidStudioProjects/SLB/app/build/pre-dexed/debug/classes-8df088fb881a9b300721edc9635f1f9db6ecf298.jar /Users/azamsharp/AndroidStudioProjects/SLB/app/build/pre-dexed/debug/gcm-dd10621f5a27ca99ec0a973a9d3d24df75dabba1.jar /Users/azamsharp/AndroidStudioProjects/SLB/app/build/pre-dexed/debug/support-v4-19.0.1-3bf117e59e2e0f41bbf9219f2be90cdcf1dd583d.jar
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:593)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:551)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:532)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:169)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:187)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
at com.android.dx.command.dexer.Main.run(Main.java:230)
at com.android.dx.command.dexer.Main.main(Main.java:199)
at com.android.dx.command.Main.main(Main.java:103)
我甚至没有对参考文献做任何事情。我只是添加了一个Activity,然后很快将其删除。
答案 0 :(得分:3)
转到" Build"在顶部"清洁项目"然后"重建项目" 它帮助到我! 你也可以去"文件"和无效的缓存"并重新启动Android Studio
corse确保清单没问题且没有重复包括!