2

I am adding admob external jar in my project and i am using andengine as a library project but when i try to export the project i get this error. Also adding andengine library project adds andengine.jar also in android dependencies. Is that suppose to happen?

I have tried almost all other answers on stackoverflow but nothing seems to work.

If anyone can help me pls?

Following is my project image

My project screenshot

Swati Rawat
  • 1,729
  • 1
  • 19
  • 34
  • have you tried this: http://stackoverflow.com/questions/2680827/conversion-to-dalvik-format-failed-with-error-1-on-external-jar and this: http://www.andengine.org/forums/tutorials/conversion-to-dalvik-format-failed-with-error-1-t8178.html – Bruno Bieri Aug 29 '12 at 05:32
  • this error occurs when you have two libraries of same type included in your project.use only andengine.jar or the andengine library.dont include both of them in your project. – hemanth kumar Aug 29 '12 at 05:42
  • @viperbone: I tried all solutions in both of these... not working with admob jar. – Swati Rawat Aug 29 '12 at 06:01
  • @hemanth kumar:- I added only andengine library which is adding andengine.jar to the dependencies folder itself. I am not doing that myself. – Swati Rawat Aug 29 '12 at 06:03
  • can you post your expanded project folder image? – hemanth kumar Aug 29 '12 at 06:09
  • I am sort of new to stackoverflow. Can you tell me how to post an image? :-) – Swati Rawat Aug 29 '12 at 06:15
  • have you tried removing all libraries and readding one by one? – hemanth kumar Aug 29 '12 at 06:22
  • I have uploaded an image of my project as you asked. Please check. – Swati Rawat Aug 29 '12 at 06:22
  • yes i have tried removing all libraries and adding one by one. If i don't add admob jar, i can export successfully but as soon i add admob, i get the error. I even tried making a new project and switching the workspace but it doesn't work. – Swati Rawat Aug 29 '12 at 06:24
  • i think andengine by default have admob references.is your ad visible in your layout when you remove the admob library? – hemanth kumar Aug 29 '12 at 06:27
  • No. If i remove admob, ads don't render and i get errors on launch because of the missing ad classes – Swati Rawat Aug 29 '12 at 06:33
  • are you adding the jars from your libs folder?if not add admob and andengine libraries from your libs folder by right-click on the file build path -> add to build path. if you aready did the same way please forgive me.. – hemanth kumar Aug 29 '12 at 06:48
  • i already did that... but thanks anyway :-) – Swati Rawat Aug 29 '12 at 06:49

4 Answers4

5

Just solved this problem. I updated my sdk to latest and that solved the problem!

Swati Rawat
  • 1,729
  • 1
  • 19
  • 34
0

Try exit eclipse, backup if you want, delete gen and bin folders. Start eclipse again, build then export.

weston
  • 54,145
  • 21
  • 145
  • 203
0

This usually happens to me after either eclipse has been running for a long time or after I have build a signed apk successfully. To fix it I just restart eclipse.

124697
  • 22,097
  • 68
  • 188
  • 315
0

In Eclipse, select the project causing the error- go to the menu project -> properties -> java build path -> libraries and remove all jars including the android jars.

Then, right click the project, go to android tools -> fix project properties. Then, add back any other external jars you wanted to add to the build path following the same menu project -> properties -> java build path -> libraries. To ensure there are no errors due to missing libraries.

Then, do a 'clean' on menu project and build again. It should work.

Jitesh Dalsaniya
  • 1,917
  • 3
  • 20
  • 36