2011-01-19 41 views
24

这符合:没有资源发现在给定的名字

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="de.androidbuch.rechner" 
    android:versionCode="1" 
    android:versionName="1.0"> 

    <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> 

是我AndroidManifest.xml和线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")

这是真的奇怪,我没有移动值文件夹的任何地方。

回答

38

您是否检查并确保您已在res/values/strings.xml中定义字符串资源?

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

有时,我注意到eclipse也会抛出错误,如果你有错误的任何.xml文件,很难追踪。我认为解析器不能很好地恢复,有时你得到的错误可能会引起误解。

+1

哦,我有时候我很愚蠢!非常感谢!该文件甚至不存在于我的程序:) – sam 2011-01-19 14:56:57

+0

此文件在我的项目中也不存在。你能提供更多的细节如何解决这个错误?我创建了strings.xml并将其放在上面的代码行中,可悲的是它本身给我一个错误。还有更多要添加到此文件吗? – ProblemsOfSumit 2013-08-26 10:36:29

-5

我遇到了同样的问题。删除"@string"android:label="@string/app_name",它会正常工作。

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

一个原因可能是因为在我的情况下,字符串GUI在当你添加在一些序列中删除项目中的错误

解决: 只需在XML打开strings.xml模式不是图形用户界面你会发现它不同,并有明显无效的附加文本粘贴在周围或开始;虽然它不会给文件上的错误strings.xml修复它们,然后清理并运行

1

我也有与我的图像相同的错误..只需重命名扩展名“.png”或任何你必须“.jpg “那么在清理完项目并重新编译之后,它们可以正常工作。

相关问题