在没有得到创建R.java文件 [英] R.java file is not getting created

查看:172
本文介绍了在没有得到创建R.java文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Andr​​oid应用程序有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,

  • 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆