Reputation: 20068
All of a sudden I am getting the following error in my project in 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)
I did not even do anything with the references. I simply added an Activity and then deleted it shortly after.
Upvotes: 1
Views: 1775
Reputation: 81
ok , I have the same problem and here is the solution:
Go to "Build" in the top and "Clean Project" and after "Rebuild the project" It helps me! Also you can go to "Files" and Invalidate caches" and restart the Android Studio
Of corse be sure that manifest is ok and no duplicate includes!
Upvotes: 3