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

后端 未结 30 2120
迷失自我
迷失自我 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 00:51

    I had the same problem, quite weird because it was happening only when using Eclipse (but it was OK with Ant). This is how I fixed it:

    • Right click on the Project Name
    • Select Build Path -> Configure Build Path
    • In Java Build Path, go to the tab Order and Export

    • Uncheck your .jar library

    Only sometimes: In Order and Export tab I did not have any jar library there, so I have unchecked Android Private Libraries item. Now my project is running.

    0 讨论(0)
  • 2020-11-22 00:56

    Deleting the bin folder was not enough, I also deleted the gen folder. Then after two rebuilds the dex error message was gone.

    0 讨论(0)
  • 2020-11-22 00:57

    I converted a non-library project to a library project, but it had a previously built jar file in the libs folder. Removing this jar file caused this error to go away.

    0 讨论(0)
  • 2020-11-22 00:57

    I was facing the same issue then i saw while pushing my app some jar files which were loaded twice hence multiple dex error .Just go to your project properties -> Java Build Path and try unchecking jar which is being loaded twice.

    0 讨论(0)
  • 2020-11-22 00:58

    I have several library projects with the same package name specified in the AndroidManifest (so no duplicate field names are generated by R.java). I had to remove any permissions and activities from the AndroidManifest.xml for all library projects to remove the error so Manifest.java wasn't created multiple times. Hopefully this can help someone.

    0 讨论(0)
  • 2020-11-22 00:59

    Solution for me:

    1. BACK UP YOUR CODE!
    2. Navigate to your project workspace (not your project) and run the following commands:

      dev1:workspace$ cd ~/Documents/workspace/.metadata/.plugins/ dev1:workspace$ rm -rf org.eclipse.core.resources

    3. Navigate to your Eclipse directory and type this command:

      dev1:eclipse$ ./eclipse clear

    4. Eclipse will start with an empty workspace - don't worry your projects are still there. Simple create new project from existing resource and things should be gravy.

    The exact error I was receiving: [2012-02-07 14:15:53 - Dex Loader] Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter; [2012-02-07 14:15:53 - ProjectCloud] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter;

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