Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;

后端 未结 30 2011
迷失自我
迷失自我 2020-11-22 00:31

Since updating to ADT 14 I can no longer build my project. It was building fine prior to updating.

The error:

[2011-10-23 16:23:29 - De         


        
相关标签:
30条回答
  • 2020-11-22 01:09

    Modify your eclipse.ini file and set the maximum memory parameter to

    -Xmx1024m
    

    Then restart your computer.

    It worked for me.

    0 讨论(0)
  • 2020-11-22 01:09

    I had two different versions of Cordova .jar-files in my libs folder, I deleted the one I wasn't even using and it worked right away. Weird because I didn't notice that before and it worked before and then suddenly stopped working...

    0 讨论(0)
  • 2020-11-22 01:11
    1. Close eclipse.
    2. Delete bin folder inside your project folder.
    3. Start eclipse and clean your project.
    4. Now run and the problem should be gone
    0 讨论(0)
  • 2020-11-22 01:11

    As others have mentioned, this occurs when you have multiple copies of the same class in your build path - including bin/ in your classpath is one way to guarantee this problem.

    For me, this occurred when I had added android-support-v4.jar to my libs/ folder, and somehow eclipse added a second copy to bin/classes/android-support-v4.jar.

    Deleting the extra copy in bin/classes solved the problem - unsure why Eclipse made a copy there.

    You can test for this with

    grep -r YourOffendingClassName YourApp | grep jar

    0 讨论(0)
  • 2020-11-22 01:11

    After trying all the other suggestions with no luck, I deleted all the contents of my projects 'bin' directory, then ran eclipse again and it worked.

    0 讨论(0)
  • 2020-11-22 01:12

    After reading Terrys response about deleting the bin directory and Larrys about the the location of the ANT directory:

    I moved the files located in my projects BIN directory to the BIN/CLASSES and im up and running.

    Edit 1 Then failed on second run...doh

    Edit 2 So closed Eclipse moved files back to original location and its all working... um what? I don't pretend to know why this worked. Will update if any changes.

    Edit 3 I have noted from my backups that there were indeed duplicate files in the BIN directory and BIN/CLASSES.

    So the answer is: don't have files in both locations. At least for me that's what worked.

    0 讨论(0)
提交回复
热议问题