“Conversion to Dalvik format failed with error 1” on external JAR

前端 未结 30 2435
抹茶落季
抹茶落季 2020-11-21 07:32

In my Android application in Eclipse I get the following error.

UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already add

30条回答
  •  走了就别回头了
    2020-11-21 07:57

    Here's another scenario, and solution:

    If you run into this problem recently after updating the ADT for Eclipse:

    1. In your app project, check for any linked source folders pointing to your library projects (they have names in the form "LibraryName_src").
    2. Select all those projects, right-click, choose "Build Path"->"Remove from Build Path".
    3. Choose "Also unlink the folder from the project", and click "Yes".
    4. Clean, rebuild and redeploy the project.

    It seems the reason is that some previous version of ADT linked Library project source folders to the "child" projects, and the current ADT/Dex combination isn't compatible with that solution anymore.

    EDIT: this is confirmed by an Android Dev Blog entry, specifically this one - see the 8th paragraph onwards.

提交回复
热议问题