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

前端 未结 30 2510
抹茶落季
抹茶落季 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 08:09

    I had the same problem and none of these solutions worked. Finally, I saw in the console that the error was due to duplicated class (one in the existing project, one in the added jar file) :

    java.lang.IllegalArgumentException: already added: package/MyClassclass;
    [2011-01-19 14:54:05 - ...]: Dx1 error; aborting
    [2011-01-19 14:54:05 - ...] Conversion to Dalvik format failed with error 1
    

    So check if you are adding jar with duplicated classes in your project. If yes, try removing one of them.

    It worked for me.

提交回复
热议问题