“Conversion to Dalvik format failed with error 1″

  ... tutorials on how to use AndEngine.

“Conversion to Dalvik format failed with error 1″

Postby kidpack » Fri Jun 08, 2012 8:34 pm

Hello,

First, forgive my English (I´m basque).

The problem is that if I do a project and include the AndEgine library (doing like in the youtube tutorial), when I try to export like a Apk file in 95% times I have this error (curiously it´s more possible to export when i turn on computer and if i modify nothing in eclipse).

I try a lot of things but nothing works. I tried modifying proguard.bat file, updating to 4.6 and 4.8, without the folder, updating eclipse, window/preferences/android/build/silent to verbose...
Cleaning project, closing and opening project, closing eclipse.. deleting the git, the Andengine project, the project and restarting..
Doing a normal Android project I don´t have the problem.

What I can do? I´m completely lost.

Thanks you a lot.
kidpack
 
Posts: 1
Joined: Fri Jun 08, 2012 7:03 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby Yman » Wed Jun 20, 2012 10:14 am

Hi, i got this problem too, after spending a whole night to figure it out, i finally found the solution ! :lol:


Remove existing referencing libraries (Right click project > properties, remove the libraries under "Android" tab and those in buildpath except for your Android.X.X/
Go to your project, create a folder "libs"
Then place the jars into the folder (andengine.jar and andengineextension.jar etc)
Make them into buildpath by right click on the jars u just placed.

Export ! Wala!
Yman
 
Posts: 3
Joined: Fri Dec 09, 2011 5:27 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby medirasoft » Tue Jun 26, 2012 6:00 am

or you can try this:
go to window->preferences->android->build and uncheck the "skip packaging and dexing until export or launch"
medirasoft
 
Posts: 11
Joined: Tue May 08, 2012 3:08 am

Re: “Conversion to Dalvik format failed with error 1″

Postby Molkobain » Wed Jun 27, 2012 8:59 am

I got this too. It appears that I can only export the APK once, then I have to close eclipse completly, reopen it and then I can export.

As it's recommended to use AndEngine as an Android library and not to use to andengine.jar file, you should probably try medirasoft solution.
Molkobain
 
Posts: 106
Joined: Wed Apr 18, 2012 4:16 pm
Location: France

Re: “Conversion to Dalvik format failed with error 1″

Postby haze » Tue Jul 03, 2012 7:56 pm

Tried the above, now i can export the file.
-But when i try to select it (in live wallpaper picker). I get an error:
java.lang.RuntimeException: Unable to instantiate service [name of package].[name of activity]
haze
 
Posts: 18
Joined: Fri Dec 31, 2010 2:04 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby haze » Tue Jul 03, 2012 8:40 pm

fixed it :-) my mistake was calling the folder "lib" instead of "libs"
haze
 
Posts: 18
Joined: Fri Dec 31, 2010 2:04 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby Molkobain » Tue Jul 03, 2012 8:48 pm

Good :)
Molkobain
 
Posts: 106
Joined: Wed Apr 18, 2012 4:16 pm
Location: France

Re: “Conversion to Dalvik format failed with error 1″

Postby driver613 » Wed Aug 01, 2012 8:44 pm

Thanks a lot.
driver613
 
Posts: 2
Joined: Mon Jun 18, 2012 8:41 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby andrewoid » Wed Aug 22, 2012 4:17 pm

Thanks for this thread guys, helped immensely when I was trying to export my project to an APK.

The key point here is to not have AndEngine or it's extensions added as an Android Library. Instead:
  • Create a folder 'libs' at the root of your project
  • Copy your andengine.jar file into that folder, as well as the JAR files for any extensions you are using. These can usually be found in the bin folder of your AndEngine directory.
  • Add any additional JAR files you are using to this same 'libs' directory.
  • Right click your project, choose Properties->Android and remove any libraries from the bottom window. After doing this you should find that your Android Dependancies in your package manager will show your required libraries only once.
  • Select Project -> Clean... -> Clean
  • Right click your project -> Android Tools -> Fix Project Properties

After that I exported to an APK and it worked fine. I ALSO had my library folder named lib instead of libs as well, I wonder if there is a guide we both followed which has that mistake in it...
andrewoid
 
Posts: 39
Joined: Fri Jun 29, 2012 1:22 pm

Re: “Conversion to Dalvik format failed with error 1″

Postby Molkobain » Wed Aug 22, 2012 4:21 pm

Actually we followed the "Android library" way instead of the jar file because it new best practice. But honestly, I don't know the differences.
Molkobain
 
Posts: 106
Joined: Wed Apr 18, 2012 4:16 pm
Location: France

Next

Return to Tutorials

Who is online

Users browsing this forum: Google Feedfetcher and 15 guests