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

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 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;
[2011-10-23 16:23:29 - myProj] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/myapp/R$array;

Similar issues have been reported and I have tried the suggestions there including

  • Restarting Eclipse .
  • Cleaning the project and rebuild - Disable "Project->Build Automatically" option, then "Clean" and "Build" project, then try to run. reset "Build Automatically" option to On
  • Re-installing the Android Developer Tools
  • Re-installing Eclipse (updated to the latest version 3.7.1)
  • Created a new project importing from the file system
  • Created a new project from subversion.

  • 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.


    My problem was resolved after cleaning up some directories and files left over from the previous versions of the tools. ADT Rev 14 changes where binaries are stored. I deleted the entire bin directory, restarted Eclipse and cleaned the build and forced a rebuild. That seemed to do the trick initially but the problem came back after the next run.

    I finally discovered that my bin directory was included in the project build path. I excluded bin from the build path and repeated the steps above. This resolved my problem.


    [Solved for me]

    Eclipse project properties->Java build path->Order and export

    Uncheck Android private libraries.

    链接地址: http://www.djcxy.com/p/65838.html

    上一篇: 在Eclipse中存储运行配置和项目

    下一篇: 无法执行dex:多个dex文件定义Lcom / myapp / R $ array;