In my Android application in Eclipse I get the following error.
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already add
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
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.
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.
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.
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.
In my case
project->properties->java build path -> in order and export tab -> uncheck android-support-v4.jar