Error using eclipse for Android - No resource found that matches the given name


Question

Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and main.xml I'm getting the no resource found that matches the given name. I've double checked for typos and it used to work, but now I'm popping up with all these errors saying it can't find my strings in my strings.xml.

These are the ones I'm getting errors for in my main.xml.

    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dip"
    android:text="@string/instructions"    />

    <TextView
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="10dip"
    android:text="@string/level_prompt"    />

    <Spinner         
    android:id="@+id/spinner"        
    android:layout_width="fill_parent"        
    android:layout_height="wrap_content"        
    android:prompt="@string/level_array"    />

These are the ones I'm getting for my androidmanifest.xml.

<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".HelloFormStuff" android:label="@string/title">

This is what my strings.xml looks like.

<string name="title">Title</string>
<string name="app_name">Application name</string>

<string name="instructions">Enter instructions here.</string>

<string name="level_prompt">Choose an item</string>

<string-array name="level_array">        
<item>Item One</item>        
<item>Item Two</item>        
<item>Item Three</item>        
<item>Item Four</item>
</string-array>

Any ideas? Any help would be appreciated!!

1
22
3/19/2010 1:32:37 PM

Accepted Answer

Accidentally moved the "values" folder outside of the "res" folder. Moved it back and it fired up!

22
3/19/2010 2:09:42 PM

This problem appeared for me due to an error in an XML layout file. By changing @id/meid to @+id/meid (note the plus), I got it to work. If not, sometimes you just gotta go to Project -> Clean...


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon