0

I've 2 Android projects in workspace; first is libray project and other is application that refers to first project. Clean and Build is fine without any error. But when I try to export release build it gives error: "Conversion to Dalvik format failed with error 1"

Please, help.

3 Answers3

1

SOLUTION 1:

Are you using proguard? if so.. you might want to replace the one in the sdk (C:\android-sdk\tools2\proguard*) with the latest version from here.

You can rename the old proguard to proguard2 and place the downloaded version in C:\android-sdk\tools2\proguard*

*Note: the folder of your AndroidSDK might be different


SOLUTION 2:

If you had imported other projects as libraries for the main project you might check if those libraries are imported twice:

Android Libraries Android Build Path

Those Images were extracted from this answer


SOLUTION 3:

Create a new Android project with the same package name, copy all your resources, Manifest and source files, configure the external libraries and then try to compile the new project

Community
  • 1
  • 1
SERPRO
  • 10,015
  • 8
  • 46
  • 63
  • I'm not using proguard. Also, haven't imported libraries twice. When I referenced library project, then in Android Dependencies > jar of library project + jar in library projects libs folder + annotations.jar (refered by library project from android-sdk-windows\tools\support) is automatically shown. I've refered no other library in main project. – himanshu.shekhar Apr 12 '12 at 06:06
  • See my new solution to see if that works.. That solved the problem for me a couple of times. – SERPRO Apr 12 '12 at 10:30
  • Had already done as you have suggested in new solution, without any luck. – himanshu.shekhar Apr 12 '12 at 10:55
  • Then I suggest you to start "removing" classes until you find if any of those are causing the problem.. – SERPRO Apr 12 '12 at 12:15
1

That usually happens when you have android.jar accidentally included twice. Go into your project's Properties > Java Build Path > Libraries and remove the one that's not under the Android X.Y drop-down.

Sparky
  • 8,437
  • 1
  • 29
  • 41
0

Problem solved. Removed r18 and went for r17 and then every thing is fine.