Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Let me start off by saying I'm brand new to Android programming. I'm using a Pragmatic's Hello Android book (3rd edition). I'm working on the popular sudoku game example, and after copying the code from the book that is to be placed in the main.xml file, I get the following errors:

error: Error: No resource found that matches the given name (at 'background' with value '@color/background')
.
error: Error: No resource found that matches the given name (at 'text' with value '@string/main_title').

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

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

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

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

They're probably all related, but after doing some searching, I don't know what the problem is. Any suggestions?

like image 964
Skizz Avatar asked Jul 22 '11 16:07

Skizz


2 Answers

Error says everything.You have a res folder where your resource like string/image/layout can reside.So you are referencing the resource but they are not present.Like you are referencing about_label string but in your string xml there is no tag for the string about_label and its value.See res->strings.Check all your xml file and put the resource you are trying to use in your program

like image 105
Rasel Avatar answered Oct 28 '22 04:10

Rasel


For the string errors, you have to define your strings in the res/values/strings.xml file like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="main_title">My Main Title</string>
</resources>

The other errors are similar. The resources aren't defined in the res folder.

like image 20
sbtkd85 Avatar answered Oct 28 '22 05:10

sbtkd85