R无法解析为变量? [英] R cannot be resolved to a variable?
问题描述
我已经尝试再次清理,再次构建项目,创建一个新项目并复制我的所有文件,去Android SDK Manager并安装所有的Android SDK Build-tools来安装所有其他stackoverflow帖子所提到的选项:
任何人都可以建议任何内容?
上图显示了我生成的文件和缺少一个R.java文件。
上图显示了我的问题日志。
确保R与您要从中调用它的文件在同一个包中。
(或在源文件中导入包)
要更改R文件的包,请打开您的App Manifest文件,并将packge =更改为与您的源文件所在的软件包相同。
I cleaned my project and now I get a "R cannot be resolved to a variable." It was fine before I cleaned it.
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?
The above picture shows my generated files and lack of an R.java file.
The above picture shows my problems log.
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)
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无法解析为变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!