0

My program is generating duplicate .dex files and I am unsure why this is happening. The console output is as follows:

[2015-09-05 18:49:47 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/googlecode/android_scripting/Analytics$1;
[2015-09-05 18:49:47 - SensibilityTestbed2] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/googlecode/android_scripting/Analytics$1;

And after every attempt to run the program, the files get duplicated once again; they look like:

ScriptActivity$1.class, ScriptActivity$2.class, ScriptActivity$3.class...etc

I have tried just about every single combination from previous SO posts, including but not limited to:

  • Unchecking different library dependencies in the Java Build Path.
  • Deleting duplicate .jar files.

But to no avail, so I was wondering if there is a way to make the compiler completely ignore these duplicate .dex files? I am working with Eclipse.

ifma
  • 3,673
  • 4
  • 26
  • 38
  • Erm ... how would the compiler know which one to ignore?? Wrong approach. Find out why the duplicates are being generated and fix it so that it doesn't happen. – Stephen C Sep 06 '15 at 02:32
  • It is not complaining that there are `ScriptActivity$1.class`, `ScriptActivity$2.class`, etc. Those are not duplicates. They are different anonymous inner classes defined in `ScriptActivity.java`. It is complaining that it can find two or more DEX files that match the `ScriptActivity$1.class` file. – Stephen C Sep 06 '15 at 02:34
  • Hi @StephenC, I was wondering if you could please point me in the right direction... Where am I supposed to look for that? I've been at it for a couple of days, it feels like I'm looking for a needle in a haystack... If you could please provide some debugging tips for this problem I would really appreciate it – ifma Sep 09 '15 at 00:59
  • 2
    We for a start ... you should be looking for duplicate "dex" files in the filesystem. – Stephen C Sep 09 '15 at 07:46
  • 2
    Also check out this Q&A: http://stackoverflow.com/questions/7870265/unable-to-execute-dex-multiple-dex-files-define-lcom-myapp-rarray – Stephen C Sep 09 '15 at 07:48

0 Answers0