Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm doing the exercise "sudoku" from the book "hello to android". I saw some people have the same issue as me but I'm unable to solve it. I have deleted three times this project and re-create from the beginning but I keep getting the same error message on below, even if I'm doing a copy/paste from the book.

W/ResourceType( 8592): Bad XML block: header size 29806 or total size 538970658 is larger than data size 0
    C:\java\Sudoku\res\layout\activity_main.xml:6: error: Error: No resource found that matches the given name (at 'text' with value '@string/hello_world').
C:\java\Sudoku\res\menu\activity_main.xml:2: error: Error: No resource found that matches the given name (at 'title' with value '@string/menu_settings').

There is the code inside the book for the Sudokuv1/res/layout/main1.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/main_title" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/continue_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/new_game_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/about_label" />
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/exit_label" />
</LinearLayout>    

There is the code for Sudokuv1/res/values/strings.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Sudoku</string>
<string name="main_title">Android Sudoku</string>
<string name="continue_label">Continue</string>
<string name="new_game_label">New Game</string>
<string name="about_label">About</string>
<string name="exit_label">Exit</string>
</resources>

Thank you for your help!

like image 832
user1805 Avatar asked Jul 31 '12 13:07

user1805


2 Answers

If you created the android app with the Elcipse plugin, in the res folder you have a menu folder and inside that folder there is another activity_mail.xml.

Erase the file or comment its content since you wont be using the menu for the sudoku app.

That should fix it.

like image 176
Felipe Avatar answered Nov 11 '22 19:11

Felipe


either add

<string name="hello_world">hi</string>

to your string.xml

or find the view called 'title' in your activity_main.xml and erase the android:text="@string/hello_world" property from it.

like image 2
Shark Avatar answered Nov 11 '22 19:11

Shark