I have a project that I’ve been using proguard with successfully for a long time, purposely running with an older version of ADB (pre r12) because I always seem to hit errors that take too long to resolve. I recently updated to r16, and doing so completely broke my ability to build on the command line using -> “ant release”
I found an overload of information that allowed me to resolve multiple problems, but now I have the following problem, and I’ve none of the suggestions I’ve tried has worked:
[dx] UNEXPECTED TOP-LEVEL EXCEPTION:
[dx] java.lang.IllegalArgumentException: already added: Lcom/android/vend
ing/licensing/AESObfuscator;
[dx] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection
.java:123)
[dx] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[dx] at com.android.dx.command.dexer.Main.processClass(Main.java:486)
[dx] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:
455)
[dx] at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[dx] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.jav
a:394)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processArchive(Class
PathOpener.java:245)
[dx] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPath
Opener.java:131)
[dx] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpe
ner.java:109)
[dx] at com.android.dx.command.dexer.Main.processOne(Main.java:418)
[dx] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:3
29)
[dx] at com.android.dx.command.dexer.Main.run(Main.java:206)
[dx] at com.android.dx.command.dexer.Main.main(Main.java:174)
[dx] at com.android.dx.command.Main.main(Main.java:95)
[dx] 1 error; aborting
BUILD FAILED
C:\Users\Public\android_sdk_r3\android-sdk-windows\tools\ant\build.xml:752: The
following error occurred while executing this line:
C:\Users\Public\android_sdk_r3\android-sdk-windows\tools\ant\build.xml:754: The
following error occurred while executing this line:
C:\Users\Public\android_sdk_r3\android-sdk-windows\tools\ant\build.xml:766: The
following error occurred while executing this line:
C:\Users\Public\android_sdk_r3\android-sdk-windows\tools\ant\build.xml:256: null
returned: 1
I know that it’s saying AESObfuscator is being added twice, but I’m not sure of all the various places that it is being pulled in to my project. Other posts referencing this problem resulted in people providing many different possible solutions. I’m hoping someone can tell me definitively what to remove.
LVL’s jar file is listed under “Reference Libraries.” I manually copied the jar file to the libs folder to resolve other errors I encountered. Right-clicking my project and selecting “Properties” -> “Java Build Path” -> “Libraries” has the LVL jar file, Android 2.2, and com.android.ide.eclipse.adt.LIBRARIES. Initially “Libraries” had Android 2.2 and “Reference Libraries” but I manually removed reference libraries at someone else’s suggestion, but this caused errors in Eclipse. I then manually added the LVL jar back in “Libraries” by selecting “Add external JAR” and the result was the 3 items above.
What do I need to do to resolve this? Thanks.
There were a few different things I did to get everything working, but unfortunately I’m uncertain if there was one certain step that did the trick.
I deleted the extra src folders that were added for each library I had after performing the upgrade.
I stopped using LVL as an external library, and just added the source code directly to my project.
In Eclipse, I went into Properties -> Android, and in the Library section of the window that appears I deleted all references.
There were specific errors that were shown in Eclipse for the proguard files being used in my project, but those were easily identified and corrected.
At this point I thought everything should have worked, but I still had problems. So I cleaned the project, and suddenly everything worked fine. So, it appears that I needed to take each of the above steps in order to solve my problem.