Reputation: 4652
I just imported my project with all dependencies to Android Studio. Once compile I see this error
Error:Android Dex: [APPA] Unable to execute DX
Error:Android Dex: [APPA] com.android.dex.DexException: Multiple dex files define Lcom/android/volley/VolleyError;
Error:Android Dex: [APPA] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
Error:Android Dex: [APPA] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
Error:Android Dex: [APPA] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
Error:Android Dex: [APPA] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
Error:Android Dex: [APPA] at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
Error:Android Dex: [APPA] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
Error:Android Dex: [APPA] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
Error:Android Dex: [APPA] at com.android.dx.command.dexer.Main.run(Main.java:246)
Error:Android Dex: [APPA] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Android Dex: [APPA] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Error:Android Dex: [APPA] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Error:Android Dex: [APPA] at java.lang.reflect.Method.invoke(Method.java:597)
Error:Android Dex: [APPA] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)
Error:Android Dex: [APPA] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)
Error:Android Dex: [APPA] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:121)
Upvotes: 0
Views: 1302
Reputation: 4652
The problem was that libraries are duplicated in the dependencies of the project. I was not using gradle so that I did not able to check the most common commands in other answers. So I fixed it opening the module settings, checked all dependencies one by one and then removed duplicates. Also I switched my project to gradle by first opening it in Eclipse and exporting it as gradle project then opened it back in Android studio.
Upvotes: 1