Thứ Hai, 15 tháng 11, 2010

Android: Problem with "DalVM" when build project

This note is created for anybody who have the same issue like me when built an Android project and got "Conversion to dalvik format failed with error 1". It occurs to me when i tried to open and build a very old Android project. The reason for it happened is:

DX tool can not convert all java classes to dex format then this error occurs. In my case when i was getting error because there are some class which are using Java standard edition references and can not converted to dex. Generally it will convert all J2Me lib to dex format.

Second scenario is that when you are changing target platform or work space then there might be some inconsistency in build and it was fixed by just cleaning and rebuilding workspace.


As the suggestion from, they said:
"please clean your project and rebuild it when you are getting this exception."
but, one more thing had to be done before:
Right click on the project, move the cursor to Android Tools and choose "Fix Project Properties"

Good luck,