繁体   English   中英

R无法解析为变量,通常的修复似乎不起作用

[英]R cannot be resolved to a variable, usual fix doesn't seem to work

我正在尝试按照https://developer.android.com/training/index.html上的google教程编译我正在装箱的Android应用程序

我遇到了一个问题,我得到错误“R无法解析为变量”

我按照其他线程的建议,如清理/重建,删除所有导入android.R,并为每个版本重新安装我的Android SDK Build-tools

以下是MyFirstApp.zip问题的教程项目的副本

我已经采取了其他线程中的建议,但他们的解决方案都没有成功。 1 2 3 4请帮忙!

如果您有任何其他信息需要解决此问题,请与我们联系。

I have seen your code there is an error inside main_activity_actions.xml which is inside your menu folder

It does not find @string/action_search which must be present in strings.xml

So put <string name="action_search">Search here</string> inside your strings.xml

and clean and build the project.

I hope the error will be solved.

当您的XML文件出错时,通常会附加它。
也许您尝试使用不再存在的XML变量。 它不会给你的XML带来任何错误。
验证文件“Value”上的XML变量以及从Java文件调用的XML变量

暂无
暂无

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

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