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?
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
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.
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