在没有得到创建R.java文件 [英] R.java file is not getting created
本文介绍了在没有得到创建R.java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在我的Android应用程序有R.java文件。但我不知道,这是删除一些如何。要重新创建清洁我的项目,并通过单击生成项目重建我的项目。我不知道是什么问题。它没有得到重新创建。一般来说它就会自动每当我建项目创建。
I had R.java file in my android application. But I don't know, It is delete some how. To create it again I clean my project and also Rebuild my project by clicking on Build Project. I do not know what is the problem. It is not getting created again. Generally It gets created automatically whenever I build project.
推荐答案
一些快速的解决方案,您的问题可能是,
Some quick solutions to your problem might be,
- 使用<大骨节病>控制骨节病> + <大骨节病>移骨节病> + <大骨节病> 0 骨节病>命令组织导入和生成所有缺少的import语句。有时,这会产生不正确的import语句这将隐藏,当你建立一个自动生成的
R.java
类。 -
研究
是生成的类。如果您使用的是href="http://developer.android.com/guide/developing/eclipse-adt.html" rel="nofollow"> Android开发工具(ADT)的该生成时项目建成。你可能有自动构建关闭。在打开它,并建立自己的项目。 - 在XML的观点错误,可能导致无法生成的R.java。穿过你的视图文件,并确保所有的XML是正确的!
- 删除,如有
进口android.R;
- 重新启动IDE。
- use the Ctrl + Shift + O command to "Organize Imports" and generate any missing import statements. Sometimes this would generate the incorrect import statement which would hide the
R.java
class that is automatically generated when you build. R
is a generated class. If you are using the Android Development Tools (ADT) it is generated whenever the project is built. You may have 'Build Automatically' turned off. Turn it on and build your project.- Mistakes in your xml views could cause the R.java not to be generated. Go through your view files and make sure all the xml is right!
- Remove, if any
import android.R;
- Restart your IDE.
这篇关于在没有得到创建R.java文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文