R 1不能被解析为一个变量? [英] R cannot be resolved to a variable?
问题描述
我打扫我的项目,现在我得到一个R不能解析为一个变量。这是罚款之前,我洗干净。
I cleaned my project and now I get a "R cannot be resolved to a variable." It was fine before I cleaned it.
我试图再次清洗它,再建项目,创建一个新的项目,我的所有文件复制过来了,我已经到了Android SDK管理器并安装了所有的Android SDK构建的工具,以安装所有像其他计算器职位的选项也提到:
I have tried cleaning it again, building the project again, creating a new project and copying all my files over, and I've gone to the Android SDK Manager and installed all the "Android SDK Build-tools" to Install all the options like the other stackoverflow posts have mentioned:
任何人都可以提出什么吗?
Can anyone suggest anything?
上图为我生成的文件和缺乏R.java文件。
The above picture shows my generated files and lack of an R.java file.
上图为我的问题记录。
推荐答案
确认R是在同一个包,你想从叫它文件。
(或导入在源文件中包)
Make sure R is in the same package as the file where you want to call it from. (or import the package in the source file)
要更改R档的包打开应用清单文件并更改装箱率=同一包作为源文件是在
To change the package of the R file open your App Manifest file and change packge="" to the same package as where your source files are in.
这篇关于R 1不能被解析为一个变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!