NOTE:

NOTE: Of late, I have been getting requests for very trivial problems that many of you are facing in your day-to-day work. This blog is not to solve your "project" problems - surely not a "Support" site.
I just love to share my knowledge in my spare time and would appreciate any questions or feedback on the articles and code I have shared. I also do appreciate thought-provoking questions that would lead me to write more articles and share.
But please do not put your day-to-day trivial problems here. Even if you do, you most probably would not get a response here.
Thanks

Search This Blog

x

Friday 18 November 2011

Android - conversion to dalvik format failed with error 1

Hi,


I am sure many of you may see this error at sometime or the other when you are developing in Android o Eclipse. Most times, I have found this work for me.


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.


My guess is that when an incompatible android jar is used to compile this error is thrown. There may be many other scenarios too that cause thsi error... you can add them below

13 comments:

  1. Hi Geetha,

    There is no good tutorial yet for doing a audio/video streaming on android device and how to setup the server and keep the files there. If you have some time and if you wish then please post some article on that.
    Appreciate your help to the community.

    Regards,
    Ankit

    ReplyDelete
  2. This one is very nicely written and it contains many useful facts. I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement expressed.

    ReplyDelete
  3. Mam i have created a program which uses android 2.2 lib and i have used ObjectAnimator of android 3.0 so i added external jar of android 3.0 but it is showing conversion to dalvik format failed with error 1

    ReplyDelete
    Replies
    1. That is because of the duplication of classes from different JARs. You class path should contain only one copy of each class.

      Delete
  4. Conversion to dalvik format fails when there are duplicate classes in the build path. Nice write. I'm enjoying your posts as well. Keep up the good work :)

    ReplyDelete
  5. Thank u so much ma'am, u saved my day !

    ReplyDelete
  6. Thanks a lot. Your solution works for me.

    ReplyDelete
  7. Thank to Saig.. It really worked out for me. You made my day!!!!!!

    ReplyDelete
  8. amazing u made ma day :)

    ReplyDelete
  9. Worked perfectly for me, thanks.

    ReplyDelete
  10. Thank you. it works fine now.

    ReplyDelete
  11. Really thank you so much :D .Its working now

    ReplyDelete