Error: Unable to open class file R.java
This question already has an answer here:
I have had same issue, all what I needed to do, was create project and restart eclipse.
//Edit: Complete collapsing of "Package" tree works as well.
This is a mighty annoying error.
It happens 100% of the time when I create a new android project.
What seems to work for me is to just delete the file (which DOES exist and is accessible by my user), then hit build, and it will regenerate it and stop moaning.
It's clearly a bug as there are too many people getting it simply by filling in the boxes in the new project dialog (like me) without even modifying any code!
Have a look at your console. It is an aapt aborted error. Since aapt is the tool that auto-generates R.java, therefore, R.java was not getting generated.
Since R.java is a auto-generated file that stores information about your drawables you should rebuild your project. Before that have a look at your layout xml files and check them for errors.
Notice that Project -> Build All should be selected. Also try to run your project.
链接地址: http://www.djcxy.com/p/91332.html上一篇: 默认密钥库文件不存在?
下一篇: 错误:无法打开类文件R.java