No resource found that matches the given name (at 'title' with value '@string/action_settings')

后端 未结 6 1255
一向
一向 2021-02-07 23:01

So I recently (like today recently) began to try to work in eclipse. I\'ve been following android developers beginners course, and everything went fine until this point. I\'ve g

相关标签:
6条回答
  • 2021-02-07 23:34

    Yes,it is that: Settings,you can use Settings instead of something here.the error often happened that you deleted the statement in the strings.xml carelessly. I also got the same thing and solved until I have seen the hint.Thank you very much Kiirani and bigmike

    0 讨论(0)
  • 2021-02-07 23:36

    add this to your res/values/strings.xml

    <string name="action_search">Search</string>
    
    0 讨论(0)
  • 2021-02-07 23:43

    I have the same error but I noticed that in res/values/strings.xml the tag is not start with "<" maybe you have the same mistake

    ?xml version="1.0" encoding="utf-8"?>
    <resources>
    
    <string name="app_name">android app</string>
    <string name="action_settings">Settings</string>
    
    </resources>
    

    my advise is make your project from the scratch

    0 讨论(0)
  • 2021-02-07 23:46

    This error means a reference is being made about a recource that has yet to be defined. If you keep going with the tutorial, they actually say you will see this error! So keep going and you will learn how to fix it in the sections following.

    0 讨论(0)
  • 2021-02-07 23:59

    ha - I am doing the tutorial and got the same thing. You copied/pasted the entire strings.xml file, but this file is missing a value that the app needs. It's a bug in their tutorial.

    Add this line back to strings.xml:

    <string name="action_settings">something here</string>
    

    Where I put "something here" I can't remember what the original text was.

    The problem is that main.xml (under res/menu), which of course we didn't touch in the tutorial, references the string "action_settings". This was deleted when you copied / pasted the entire string.xml from their example.

    0 讨论(0)
  • 2021-02-08 00:00

    SOLVED:

    add ..\res\values\strings.xml

    <string name="action_settings">Action Settings</string>
    

    And Update ..\src\com\example\helloworld\MainActivity.java Line 18 with follows

    getMenuInflater().inflate(R.menu.main, menu);

    it worked for me.

    thanks

    0 讨论(0)
提交回复
热议问题