Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Conversion to Dalvik format failed with error 1" -- on export only

I know this is a repeat question but I've read and tried every solution on this site and I'm still getting the error; also, I'm getting it ONLY when I export my signed apk from Eclipse. I'm able to build and run the unsigned apk.

I have:

  • Deleted (and later restored) all libraries from the build path
  • Cleaned and rebuilt all my projects
  • Restarted Eclipse with -clean option
  • Re-create the app project from scratch

I know error 1 means I have duplicate symbols but I've checked, clean and rebuilt my build path a million times and I still get the error, only when I export.

  • If I had duplicate symbols, wouldn't I get an error 1 for my unsigned apk too?
  • If I really do have duplicate symbols, how can I get Eclipse to tell me what they are? All I get from the export wizard is a one-line error dialog. :(
  • I don't get any errors when I manually sign the apk, but when I install it on a phone I get a simple error: "Application not installed." :(:(

My project structure is as follows:

  1. One Android library project with 99% of my code. It has one copy of the required jar files in the build path.
  2. One Android app project with two classes. It references the library project via the Android tab, NOT the Java build path. There are no additional sources, projects or libraries referenced in the build path except for Android 2.1. I even re-created this project from scratch (I didn't re-created the library project because it's much bigger).

Everything was working a few days ago! Any suggestions are much appreciated!

Thanks in advance...

EDIT-UPDATE: The error goes away when I disable Proguard. Very strange.

like image 253
Barry Fruitman Avatar asked Nov 17 '11 03:11

Barry Fruitman


3 Answers

This is an issue with Proguard in the Windows developer tools - edit Android SDK\tools\proguard\bin\Proguard.bat

Replace:

call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*

with:

call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

Keep a reference to this solution because next time you update the SDK tools it'll probably be reintroduced (has been present in last few releases).

like image 84
Jon Hall Avatar answered Oct 17 '22 04:10

Jon Hall


Upgrade your Proguard to its latest version i.e., 4.7... Dowload the zip from http://sourceforge.net/projects/proguard/files/latest/download?source=files .... then copy the "lib" and "bin" folders from the zip to your sdk/tools/proguard/ to replace the default or say old "bin" and "lib" .... try exporting your project once again...

like image 41
Achin Kumar Avatar answered Oct 17 '22 06:10

Achin Kumar


Go to project and unselect Build Automatically. Then Clean the project and Build all. Worked for me to export signed application package

like image 24
anjaneya Avatar answered Oct 17 '22 04:10

anjaneya