昨天我正在研究我的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').
有沒有人有任何想法可能會導致此?我已經嘗試清理該項目,但沒有奏效。android devleopment R無法解析爲變量(沒有資源發現錯誤)
編輯
6號線我的main.xml的是<item
所以我加了該項目的其餘部分。我的整個main.xml包含這個項目。
<item
android:id="@+id/action_settings"
android:orderInCategory="100"
android:title="@string/action_settings"
app:showAsAction="never"/>
您是否使用了正確的R?檢查以確保你沒有使用android.R – Rarw