Help needed to figure out why I keep getting error messages in Eclipse
Hello,
I recently purchased a book called "The Complete Idiot's Guide to Android App Development", which I guess makes me a complete moron, because I need some help figuring this out. I want to first point out that as the name suggests I am very much a cherry when it comes to programming, and I am also recovering from a mild traumatic brain injury but I made a promise to my wife and self that I would do it. That said, please forgive me if I need someone to "dumb-it-down" for me. Without further ado:
I am building the Basic Recipe App from chapter 2 of the above book using:
Windows 7 Home Premium x64
Eclipse 3.62 Helios
Android SDK (most recent)
JDK x64 (most recent)
JRE x64 (most recent)
================================================== ====================
The wirtten code is (xml.main):
<?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:id="@+id/welcome_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
* android:text="@string/welcome_title"
/>
<Button
android:id="@+id/search_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/search_button"
/>
<Button
android:id="@+id/new_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/new_button"
/>
<Button
android:id="@+id/help_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/help_button"
/>
<Button
android:id="@+id/exit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/exit_button"
/>
</LinearLayout>
The Errors message is:
error: Error: No resource found that matches the given name (at 'text' with value '@string/welcome_title')
--------------------------------------------------------------------------------------------------------------------
The written code is (strings.xml):
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Recipe Basics</string>
<string name="welcom_title">Welcome to Your Recipes!</string>
<string name="search_button">Find a Recipe</string>
<string name="new_button">Create New Recipe</string>
<string name="help_button">Help</string>
<string name="exit_button">Quit</string>
</resources>
There was no error found in strings.xml.
================================================== ================
The code in Eclipse appears exactly as it does in the book, however it is not working. I have started over, I have performed a project clean, and at this point I am at a loss. Please if someone could point me in the right direction it would be greatly appreciated.
Re: Help needed to figure out why I keep getting error messages in Eclipse
Quote:
Originally Posted by
RookieCodeWriter
Hello,
I recently purchased a book called "The Complete Idiot's Guide to Android App Development", which I guess makes me a complete moron, because I need some help figuring this out. I want to first point out that as the name suggests I am very much a cherry when it comes to programming, and I am also recovering from a mild traumatic brain injury but I made a promise to my wife and self that I would do it. That said, please forgive me if I need someone to "dumb-it-down" for me. Without further ado:
I am building the Basic Recipe App from chapter 2 of the above book using:
Windows 7 Home Premium x64
Eclipse 3.62 Helios
Android SDK (most recent)
JDK x64 (most recent)
JRE x64 (most recent)
================================================== ====================
The wirtten code is (xml.main):
<?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:id="@+id/welcome_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textStyle="bold"
* android:text="@string/welcome_title"
/>
<Button
android:id="@+id/search_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/search_button"
/>
<Button
android:id="@+id/new_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/new_button"
/>
<Button
android:id="@+id/help_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/help_button"
/>
<Button
android:id="@+id/exit_button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
* android:text="@string/exit_button"
/>
</LinearLayout>
The Errors message is:
error: Error: No resource found that matches the given name (at 'text' with value '@string/welcome_title')
--------------------------------------------------------------------------------------------------------------------
The written code is (strings.xml):
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Recipe Basics</string>
<string name="welcom_title">Welcome to Your Recipes!</string>
<string name="search_button">Find a Recipe</string>
<string name="new_button">Create New Recipe</string>
<string name="help_button">Help</string>
<string name="exit_button">Quit</string>
</resources>
There was no error found in strings.xml.
================================================== ================
The code in Eclipse appears exactly as it does in the book, however it is not working. I have started over, I have performed a project clean, and at this point I am at a loss. Please if someone could point me in the right direction it would be greatly appreciated.
First of all welcome to the forum :) I'm also sorry to hear about your brain injury - nothing to serious I hope.
I've just recently started some Android programming myself, but tend to go for the java class based approach to UI layout rather than XML. So forgive me I've I'm not fully acquainted with this particular method - saying that though I have worked with XML a while back when I was trying to put together a web service, so despite being a little fuzzy I'll see what I can do to help.
Hmm, I think these couple of lines could be the issue:
Code :
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Recipe Basics</string>
<string name="welcom_title">Welcome to Your Recipes!</string> // should this be welcome_title instead
<string name="search_button">Find a Recipe</string>
<string name="new_button">Create New Recipe</string>
<string name="help_button">Help</string>
<string name="exit_button">Quit</string>
</resources>