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 gotten to building a simple user interface (http://developer.android.com/training/basics/firstapp/building-ui.html#Button) and did EVERYTHING word for word, but when I try to run it it says that
No resource found that matches the given name (at 'title' with value '@string/action_settings').
I went back and checked everything, and I did everything as they explained and it still does this? I'm a total noob, so maybe I'm just missing something but I don't know what. I restarted eclipse, and it still wouldn't run the app, and said for the millionth time I have an error.
This is my design sheet:
In layout activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send" />
</LinearLayout>
in values string.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My First App</string>
<string name="edit_message">Enter a message</string>
<string name="button_send">Send</string>
<string name="menu_settings">Settings</string>
<string name="title_activity_main">MainActivity</string>
</resources>
and that's ALL I've messed with. I don't see a problem?
Am I missing something obvious?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With