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

后端 未结 30 2008
迷失自我
迷失自我 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:46

    [Solved for me]

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

    Uncheck Android private libraries.

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

    None of the above helped. It was a simple problem in the end.

    I had a project which uses the FacebookSDK and ViewPagerIndicator as library projects. All were built on Android API 16 and those two projects used the android support library vX (X not being 16!)

    I added an external JAR to both those projects and pointed it to \extras\android\v4... And also removed the v4 jar I had in their libs folders.

    Clean all projects and re-build.

    Voilla!

    The exact error I was receiving: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter; Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Landroid/support/v4/view/PagerAdapter;

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

    This error can happen if you have two jars that contains the same class names, e.g. I had two library: jsr311-api-1.1.1.jar, and jersey-core-1.17.1.jar, both containing the class javax.ws.rs.ApplicationPath. I removed jsr311-api-1.1.1.jar and it worked fine.

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

    Select the project in Project Explorer, right-click and select Properties -> Java Build Path -> Source -> Check the box for Allow output folders for source folders

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

    The ADT R14 update changes where the classes go to the bin/classes directory (see http://tools.android.com/recent/buildchangesinrevision14). If you are using ANT, you should change the path for your classes from bin to bin/classes. This worked for me.

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

    I removed Android dependencies from build path and it worked.

    Edit: ignore that. I had same jar in my maven dependencies and libs folder. I removed the one at the lib folder.

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