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

前端 未结 30 2404
抹茶落季
抹茶落季 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:53

    If you have ADT revision 12+, you should update your proguard from 4.4 -> 4.6 (as described here). Also, you should leave ...\bin\proguard.bat file in the orginal form.

    Just download it from the web, and copy lib folder from downloaded package to the :

    [Android SDK Installation Directory]\tools\proguard\lib

    0 讨论(0)
  • 2020-11-21 07:54

    This can also be caused if you have added Android.jar file to your build path, perhaps by an accidental quick fix in Eclipse. Remove it with right clicking Project -> build path -> configure build path -> android.jar, remove.

    0 讨论(0)
  • 2020-11-21 07:54

    None of previously proposed solutions worked for me. In my case, the problem happened when I switched from referencing a library source code folder to using the library JAR file. Initially there was an Android library project listed under the Android application project Properties\ Android page\ Library section, and the library compared also in project explorer tree as a link to the library source directory.

    In the first place, I just deleted the directory link from the project tree and I added the JAR library to the build path, but this caused the exception.

    The correct procedure was (after changing back the build path and putting back the reference to the library source):

    • properly remove the library source directory link by actually removing the reference from application project Properties\ Android page

    • adding the library JAR to the application project build path as usual.

    0 讨论(0)
  • 2020-11-21 07:54

    I am using Android 1.6 and had one external JAR file. What worked for me was to remove all libraries, right-click project and select Android Tools -> *Fix Project Properties (which added back Android 1.6) and then add back the external JAR file.

    0 讨论(0)
  • 2020-11-21 07:55

    I solved the problem.

    This is a JAR file conflict.

    It seems that I have two JAR files on my buildpath that include the same package and classes.

    smack.jar and android_maps_lib-1.0.2

    Deleting this package from one of the JAR files solved the problem.

    0 讨论(0)
  • 2020-11-21 07:55

    In my case

    project->properties->java build path -> in order and export tab -> uncheck android-support-v4.jar

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