Search code examples
androidxmlstringout

Where can I find out.xml file for an Android Application?


Since I am new to Android I got stuck in a problem that seems to be pretty common for newbies (Error in an XML file: aborting build), after trying to add a new string in my strings.xml file.

I have searched the web and many developers (actually, the majority) suggested that I should delete blabla.out.xml. I know it may sound dumb (or mega-dumb, your call), but I really have issues in finding the out.xml file. Either my problem hasn't got the same nature as other people problem (which I doubt), but I cannot find my out.xml file.

If you could indicate me where can I find it, or if you could indicate me another solution that would be great.

Thank you in advance.

Edit:

my activity_main.xml file:

     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="horizontal"
tools:context=".MainActivity" >

 <EditText>
    android:id="@+id/edit_message"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:hint="@string/edit_message"
 </EditText>   

In strings.xml I wanted to add a string with the name edit_message in order to show an initial message in my textbox (EditBox)


Solution

  • I would suggest you to read this guide : String Resources

    You need to understand Android project folders hierarchy.
    Take a look in Eclipse : Your Project Name > res > values > strings.xml. It is supposed to be like this :

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    
        <string name="hello">Hello World!</string>
        <string name="app_name">Hello Android</string>
    
    </resources>
    

    Edit : You need to add edit_message to strings.xml :

    <?xml version="1.0" encoding="utf-8"?>
        <resources>
    
            <string name="hello">Hello World!</string>
            <string name="app_name">Hello Android</string>
            <string name="edit_message">Your message</string>
    
        </resources>