Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Crashlytics Multiple dex files define error

I use intellij 14.0.3.
By using "install plugin from disk" I installed Crashlytics intellij plugin.
When I try to import Crashlytics inside my code and build I get following error.

Error:Android Dex: [myapplication] Unable to execute DX
Error:Android Dex: [myapplication] com.android.dex.DexException: Multiple dex files define Lcom/crashlytics/android/A;
Error:Android Dex: [myapplication] at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:594)
Error:Android Dex: [myapplication] at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:552)
Error:Android Dex: [myapplication] at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:533)
Error:Android Dex: [myapplication] at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:170)
Error:Android Dex: [myapplication] at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
Error:Android Dex: [myapplication] at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:439)
Error:Android Dex: [myapplication] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:287)
Error:Android Dex: [myapplication] at com.android.dx.command.dexer.Main.run(Main.java:230)
Error:Android Dex: [myapplication] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Error:Android Dex: [myapplication] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
Error:Android Dex: [myapplication] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Error:Android Dex: [myapplication] at java.lang.reflect.Method.invoke(Method.java:606)
Error:Android Dex: [myapplication] at org.jetbrains.android.compiler.tools.AndroidDxRunner.runDex(AndroidDxRunner.java:161)
Error:Android Dex: [myapplication] at org.jetbrains.android.compiler.tools.AndroidDxRunner.main(AndroidDxRunner.java:294)
Error:Android Dex: [myapplication] at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:130)

I uninstalled plugin and reinstalled but I still get this problem.
Plugin creates a crashlytics.jar file inside project's lib folder.
When I delete that file, plugin automatically creates a new one.

How can I find the problematic issue ? Currently I include these libraries:
- Google play services
- Google analytics
- Android support lib
- Loopj async http lib
- Commons lang lib

like image 474
trante Avatar asked Mar 17 '23 04:03

trante


1 Answers

This happened to me when updating to fabric. I had to delete crashlytics.jar from the libs folder.

like image 81
jeprubio Avatar answered Mar 27 '23 23:03

jeprubio