我修改了一個可以正常工作的無錯項目並得到了錯誤 - R無法解析爲變量。我的R文件沒有被生成。我一直在我的佈局XML得到這個錯誤 -R無法解析爲變量 - 找不到佈局錯誤的來源
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 /價值/ strings.xml中的條目 -
<string name="show_answer_button">Show Answer</string>
我試圖再次構建我的項目,但它沒有幫助。我嘗試了幾個更多的答案,他們沒有工作。
我不知道我犯了什麼錯誤。我需要幫助來解決它。
編輯 - 當我試圖清理我的項目而已,我得到的錯誤 -
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.
清理項目,並檢查是否有你'res'文件夾中的任何錯誤或不 –
@praveenSharma - 是的,錯誤是造成通過res/layout中的佈局xml。但我沒有看到任何問題。 –
在哪條線上有錯誤仍然存在。 –