15

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.

Barry Fruitman
  • 12,316
  • 13
  • 72
  • 135

8 Answers8

20

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).

Jon Hall
  • 224
  • 2
  • 3
  • That bug is fixed in v15 of the SDK. Long story short I had to run Proguard from the command line to see the error message and fix my project. – Barry Fruitman Nov 23 '11 at 08:20
  • I should have marked this as the correct answer a long time ago. Thank you! – Barry Fruitman Jan 08 '12 at 00:00
  • 1
    I have library projects and fixing this error only works if I clean all projects that my export project depends upon as well as the project I am exporting. – Roy Hinkley Jul 16 '12 at 14:01
9

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...

Achin Kumar
  • 777
  • 6
  • 11
  • This worked for me. I had the old proguard and when I upgraded to a newer Android SDK, I ran into this issue. Thanks for the help bro. – Gaff Feb 17 '12 at 03:51
  • 1
    This worked for me. And let me add that I downloaded version 4.8 not 4.7 since that was the latest and greatest. Furthermore, do not replace the whole proguard package but **only** the bin and lib directories (as is also described above), otherwise it won't work. – TommyTh Aug 14 '12 at 09:36
  • I think this is the working solution for most of the occasions. Every time I face this error, I just upgrade ProGuard to the latest and then it works. Also remember to give big enough heap size to Eclipse in eclipse.ini. Something like 1024M for bigger projects. – WindRider Jan 08 '14 at 19:18
4

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

anjaneya
  • 708
  • 9
  • 11
  • You should flag this question as a duplicate instead of writing an answer that you wrote before [here](http://stackoverflow.com/questions/15940692/conversion-to-dalvik-format-failed-with-error-1-in-android-on-export-adt-21/20560330#20560330). – Ja͢ck Dec 16 '13 at 13:29
1

This was driving me insane too. I tried everything, changed all my external libraries and so on but nothing worked. I tried a newer version of proguard without success.

Turns out I was using a library called "GridLayout" to support older devices. After I renamed the class "GridLayout" to "CustomGridLayout" it worked fine. Seems like you can't have duplicate class names.

0

Here was the key that worked for me

http://android.foxykeep.com/dev/fix-the-conversion-to-dalvik-format-failed-with-error-1-with-adt-14

Supposedly fixed in ADT-15, the workaround is

1) For each X_src element,right click on it and then Build Path > Remove from build path.

2) A popup will open. Make sure that “Also unlink the folder from the project” is checked and then accept it.

You can still debug into library code but you need to manage your breakpoints in those projects and then step through the code in the class file tabs.

Melinda Green
  • 2,100
  • 1
  • 21
  • 32
0

I tried a few of the above solutions, and had no luck. Then, I closed Eclipse, and re-opened it, and was able to export successfully. If I try again however, it wouldn't work.

So, I think maybe I only get one successful export per "open" of Eclipse. Not an ideal solution by any means, but when all else fails give it a shot. It worked for me.

boltup_im_coding
  • 6,345
  • 6
  • 40
  • 52
0

The accepted answer to this question (from 2011) did not work for me. However, the correct answer to this question is posted here:

Android export give a "Conversion to Dalvik format failed error1"

Community
  • 1
  • 1
doctorram
  • 1,112
  • 14
  • 13
0

Unselect Build Automatically works for me. Tanks anjaneya;

0)Unselect Build Automatically 1) Clean the project 2) Build project. 3) Export Signed Application in Android Tools options.

GFPF
  • 959
  • 14
  • 19