R.java 被删除时生成 android-support-v4 错误
好的,我正在遵循步骤。
1-从现有源创建新项目
2-选择 Android\android-sdk\extras\android\compatibility\v4\samples\Support4Demos
3-完成
因此,我美丽的 Eclipse 创建了该项目,但他从 gen 中删除了 R.java 类我从包的每个类中收到错误。我
还认为,style.xml 给了我一些错误。
这简直要了我的命,因为三天来我无法从中学到任何东西,而且我的朋友谷歌也没有帮助解决这个问题。
提前谢谢!
ok, steps im following.
1-create new project from existing source
2-select Android\android-sdk\extras\android\compatibility\v4\samples\Support4Demos
3-finish
So, my beautiful eclipse creates the project but he erase the R.java class from gen so i get errors from every class of the package. I thing
Also, style.xml give me some error.
This is killing me because i can learn nothing from this for 3 days and i my friend google is not helping with this.
thx in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在 Eclipse 中尝试了同样的操作,我看到大多数文件都导入失败:
因此,我修复它的方法是:
最后两个步骤可能不需要。但当你做到这一切时,它可能会解决它。您还需要修复 XML 文件中的任何错误。
编辑:
试试这个:
Android 3.2 引入了 Holo 主题。
I tried the same thing in Eclipse, and I saw on Most every file, there was a failed import:
So, what I did to fix it, was:
The last two steps might not be needed. But when you do all this, it may fix it. You would also need to fix any error in the XML file.
EDIT:
Try this:
Android 3.2 was when the Holo theme was introduced.
自 ADT 17.0.0 问题起,您应该将
android-support-vX.jar
放入/libs
文件夹,如果您想在中应用 Holo 主题您的应用程序应使AndroidManifest.xml
中的targetSDKversion
至少等于 11Since ADT 17.0.0 issue you should put
android-support-vX.jar
to/libs
folder and if you want to apply Holo theme in your application you should maketargetSDKversion
inAndroidManifest.xml
equals 11 minimum由于 style.xml 中存在错误,R.java 消失了。修复 Style.xml 中的错误,R 将能够重新生成,并且一切都将膨胀。
编辑:
然后转到:
项目 ->干净的
R.java is gone because of the error you have in style.xml. Fix the error in Style.xml and R will be able to regenerate and all shall be swell.
EDIT:
Then go to:
Project -> Clean
我禁用了自动更新,删除了 bin 和 gen 文件夹,进行了清理(将给出错误,只需忽略),修复了项目设置,添加了兼容性库,然后它就工作了:)
I disabeled automatic update, deleted bin and gen folder, cleaned (will give error just ignore), fixed project setup, added compatability library and then it worked :)