R无法解析为变量 - 无法找到布局错误的来源

时间:2014-01-10 07:43:46

标签: android

我修改了一个有效的,无错误的项目并得到了错误 - 无法将R解析为变量。我的R文件没有生成。我在布局xml中不断收到此错误 -

Error: No resource found that matches the given name (at 'text' 
with value '@string/show_anwser_button')

布局有 -

<TextView
    android:id="@+id/showAnswerButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="24dp"
    android:text="@string/show_answer_button" />

尽管在res / values / strings.xml中输入了一个条目 -

,但仍会发生这种情况
<string name="show_answer_button">Show Answer</string>

我试图再次构建我的项目,但它没有帮助。我在SO上尝试了几个答案,但它们没有用。

我不知道我在哪里弄错了。我需要帮助来解决它。

编辑 - 当我尝试仅清理我的项目时,我收到错误 -

Errors occurred during the build.
Errors running builder 'Android Package Builder' on project 'GeoQuiz'.
Problems encountered while deleting resources.
Could not delete '/GeoQuiz/bin/res'.
Problems encountered while deleting resources.
Problems encountered while deleting files.
Could not delete: C:\workspace - Android\GeoQuiz\bin\res\crunch.
Could not delete: C:\workspace - Android\GeoQuiz\bin\res.
Problems encountered while deleting resources.
Could not delete '/GeoQuiz/bin/res'.
Problems encountered while deleting resources.
Problems encountered while deleting files.
Could not delete: C:\workspace - Android\GeoQuiz\bin\res\crunch.
Could not delete: C:\workspace - Android\GeoQuiz\bin\res.

2 个答案:

答案 0 :(得分:0)

android:text =“@ string / show_anwser_button”/&gt;

anwser!=答案应该是

有错字:)

之后清理并构建项目

答案 1 :(得分:0)

搜索所有布局文件

show_anwser_button

将其更改为

show_answer_button