简体   繁体   English

未创建R.java

[英]R.java is not created

I've found out that my R.java is never created. 我发现从未创建过R.java。 I'm using Android Studio and rebuilding does not solve the problem as well. 我正在使用Android Studio,并且重建也无法解决问题。

As far as i can see i don't have any mistakes in my XMLfiles as well. 据我所知,我的XMLfile也没有任何错误。 I'm using W7. 我正在使用W7。 The error cannot resolve symbol R resolves. 该错误无法解决,符号R解决了。

Please help! 请帮忙!

Code can be found here 代码可以在这里找到

If you have an error on your any code. 如果您的任何代码有错误。 No clean/build works to build R.java . 没有清理/构建可以构建R.java

Just check your whole codes fix errors manually (Because of R.java is not builded it will show errors everywhere. So you have to find and fix errors on your own.) 只需手动检查整个代码即可修复错误(由于未构建R.java,它将在所有地方显示错误。因此,您必须自己查找并修复错误。)

I have created a new project and copy-pasted your code and it works fine (in Intellij IDEA 12 at least). 我创建了一个新项目并复制粘贴了您的代码,它工作正常(至少在Intellij IDEA 12中)。 I have dropped the line (this one android:theme="@style/AppTheme" ) with theme because you haven't provided code for your theme. 我删除了android:theme="@style/AppTheme"行(此android:theme="@style/AppTheme" ),因为您尚未提供主题代码。

If you haven't added any gfx or other files and you're absolutely sure about the correctness of you theme style, then try to create a new project and do the same I did - code copy & paste. 如果您尚未添加任何gfx或其他文件,并且绝对确定主题样式的正确性,请尝试创建一个新项目并执行与我相同的操作-代码复制和粘贴。

通常是由于资源名称中的字符不可接受,请检查破折号,空格和大写字母并让项目刷新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM