开发者

Android Development - Conversion to Dalvik format failed with error 1

So I'm dipping my toes into this area for the first time - i followed instructions to install the android SDK and eclipse plug in. I created a blank new android project and I get the following build errors:

[2011-01-08 16:34:55 - xxx]: Dxno classfiles specified
[2011-01-08 16:34:55 - xxx] Conversion to 开发者_JS百科Dalvik format failed with error 1

I've googled the problem and tried to clean and rebuild, or hitting F5 on the project in the explorer but the issue remains. I've verified the build paths and the libraries to make sure only Android 2.3 is there but still get this issue.

I have also tried to load a sample project and I get the same error.

Any ideas?


This problem happens when the java files in the Eclipse project are not compiled to class files. The message indicates that the Android SDK cannot proceed to convert these classes to dalvik format because it could not find them. To solve this problem:

  1. Verify that the src folder is in your build path ( check under "Project Properties" -> "Java build path" ). If this is not the case right-click on the src folder, go to "Build path" and click on "Use as source folder".
  2. Verify that under "Project properties" -> "Builders" you can find "Java builder". If this is not the case close the project and with a text editor open the file .project present in the root folder of the project itself. Add under <buildSpec> the following lines:

    <buildCommand>
       <name>org.eclipse.jdt.core.javabuilder</name>
       <arguments></arguments>
    </buildCommand>
    

    After performing the actions described above, re-open the project and proceed to rebuild it by clicking on "Project" -> "Clean"


I fixed this - none of the above helped.

What i did was delete eclipse, download the latest one and reinstalled the ADT plugin and it works now.


Simply edit the "project.properties" file and comment the line:

proguard.config=proguard.cfg

to be like the following:

#proguard.config=proguard.cfg

then clean the project. Hope this will export to APK successfully.


The answer is detailed here. Try these steps, and it should work out.


I had the same problem: try to clean the project (Project -> Clean...). Eclipse will recreate the right bin directory.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜