给定的名称没有匹配的资源

我在AndroidManifest.xml中设置了下面的代码:

<uses-sdk android:minSdkVersion="7"></uses-sdk>
<application android:icon="@drawable/icon" android:label="@string/app_name"
 android:theme="@android:style/Theme.Light">

    <activity android:name=".FormularActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

在 8 & 11行得到了以下的错误:

no resource found that matches the given name(at "label" with value "@string/app_name")

no resource found that matches the given name(at "label" with value "@string/app_name")

我没有移动文件夹值。为什么会有给定的名称没有匹配的资源这样的错误呢?

检查res/values/strings.xml中是否定义了字符串资源。

<string name="app_name">"My App"</string>

有时候,如果一些.xml文件有错,eclipse 也难以追踪也会抛出错误。

看看你的string.xml里面是否用app_name这个名字的字符串
可能是你把这个名字改了所以就报错了

android:label="@string/app_name"中把"@string"删除,就可以了。

android:label="@string/app_name"  ->  android:label="app_name"