Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Help needed to figure out why I keep getting error messages in Eclipse

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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"
    androidrientation="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.


  2. #2
    Junior Member
    Join Date
    Aug 2010
    Location
    UK
    Posts
    19
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Help needed to figure out why I keep getting error messages in Eclipse

    Quote Originally Posted by RookieCodeWriter View Post
    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"
    androidrientation="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:

     
    <?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>
    Last edited by Bacon n' Logic; March 18th, 2012 at 12:33 PM.

Similar Threads

  1. Replies: 2
    Last Post: September 11th, 2012, 05:10 PM
  2. I can't figure out why i keep getting this error
    By chrissy2860 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: September 17th, 2011, 04:06 PM
  3. [SOLVED] Simple error that I can't figure out how to fix
    By javapenguin in forum What's Wrong With My Code?
    Replies: 8
    Last Post: July 11th, 2011, 08:27 AM
  4. just one more error that i cannot figure out please help me.
    By knoxy5467 in forum What's Wrong With My Code?
    Replies: 31
    Last Post: June 14th, 2011, 10:04 AM
  5. Error Messages Best Practices
    By Dalek_Supreme in forum Java Theory & Questions
    Replies: 0
    Last Post: April 1st, 2011, 08:22 PM

Tags for this Thread