我知道以前有人问过这个问题,我也见过太多的解决方案,但似乎没有一个适合我。我能够构建我的apk没有问题,直到这个错误开始出现。我尝试过清理我的项目,从工作区中删除它并重新导入它,从项目的Builders中删除“Java Builder”,手动构建项目,重新排序我的Java构建路径。我没有可见的编译器问题,在我的工作空间中也没有问题。
我以前确实遇到过这个问题,并通过从我的工作空间中删除项目并重新导入它来解决它,另一次我通过从我的Java构建路径中删除“Java Builder”来解决它。这次似乎没有一个成功。我目前有大部分设置设置回默认值(即java构建再次检查)。
我正在运行windows 7(64位),并通过Eclipse 3.6使用jdk1.6.0_21。
任何建议都将非常感谢,因为我已经失去了大量的开发时间来解决这个问题。
[更新]我的语言环境是英语&我已经尝试删除调试。密钥库,美国作为相关的834号
我试着把其他人最好的答案收集起来,一步一步地列出了一些可以尝试的事情:
Check the project is not set as a library:
Go to Project->Properties
Select Android from left-hand side list
Uncheck the "Is Library" checkbox
Clean and rebuild the project - this should delete and recreate the entire gen folder, including the R.java file mentioned in some peoples answers
Check eclipse and all the Android plugins are up to date
Close the project, exit Eclipse, reopen eclipse, reopen the project.
Go to Java Build Path > Projects and check for any incorrect project dependencies
Go to the main preferences for Eclipse and under Android->Build uncheck 'Skip packaging and dexing until export or launch'
Check JAVA_HOME is set correctly. Follow the steps in this article
如果你完成了上面的列表,但仍然没有解决问题,请留下评论,或者如果你发现了其他有效的方法,请随意编辑答案并添加你的东西。