【发布时间】:2014-05-09 03:12:05
【问题描述】:
昨天我正在开发我的 Android 应用程序,它运行良好。但是今天当我打开它时,我收到了错误R cannot be resolved to a variable,我不知道为什么会这样。在控制台中我收到此错误[2014-03-29 11:04:59 - RockPaperScissors] C:\Users\hosfo_000\workspace2\RockPaperScissors\res\menu\main.xml:6: error: Error: No resource found that matches the given name (at 'title' with value '@string/action_settings').
有谁知道可能是什么原因造成的?我已经尝试清理项目,但没有奏效。
编辑
我的 main.XML 的第 6 行是 <item 所以我添加了该项目的其余部分。我的整个 main.xml 包含这个项目。
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never"/>
【问题讨论】:
-
您使用的是正确的 R 吗?检查以确保您没有使用 android.R
标签: java android resources r.java-file