Saturday, June 26, 2010

Dalvik ate my projects

I got too clever and wrote a script to build my Android apps. I added the android\tools directory to my system path to help with this.

The script worked fine but problems started when I opened Eclipse. I was patching a file and the build failed with these details:

Problems occurred building the selected resources.
Errors running builder 'Java Builder' on project 'xyz'.
java.lang.NullPointerException
These errors were in the Problems tab:
  • Conversion to Dalvik format failed with error 1
  • R cannot be resolved to a variable

All I had done was add the android tools directory to the system path Troubleshooting 101- even if you don't understand how your change might have caused a problem, undo the change anyway. I undid my path change.

When I tried to build my projects (yes all had the same errors), I still had the Dalvik error listed.
I deleted the error (yes you can! Errors can get stuck and sometimes have to be deleted) from the Problems tab and rebuilt. Then I got:
Could not find xyz.apk!
I manually exported an unsigned apk from the project. This finally fixed things. I had to do similar steps on all my projects.

No comments:

Post a Comment

Thanks for your feedback!