关于Android报错:error: Error: No resource found that matches the given name (at 'label' with value)
2011-10-08 10:15
701 查看
Android报错:error: Error: No resource found that matches the given name (at 'label' with value)
当你新建一个activity时必须要在Manifest中注册:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="g.szpt.activity"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Activity03Activity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ResultActivity" android:label="@string/result">
</activity>
</application>
</manifest>
但是很奇怪注册也没错啊,原来在strings文件中赋值的时候:
<string name="result">result</string> " "的字符串和你的赋值是一样的,这样的话在你在manifest中注册的时候就会报错
所以只要把他们改写不一样就OK了!!
当你新建一个activity时必须要在Manifest中注册:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="g.szpt.activity"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Activity03Activity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".ResultActivity" android:label="@string/result">
</activity>
</application>
</manifest>
但是很奇怪注册也没错啊,原来在strings文件中赋值的时候:
<string name="result">result</string> " "的字符串和你的赋值是一样的,这样的话在你在manifest中注册的时候就会报错
所以只要把他们改写不一样就OK了!!
相关文章推荐
- 关于error: Error: No resource found that matches the given name (at 'text' with value '@string/hello')
- Android studio b Error: No resource found that matches the given name (at 'src' with value '@dra...
- Android布局问题: No resource found that matches the given name (at 'layout_above' with value @id/tv)
- Error: No resource found that matches the given name (at 'theme' with value '@style/ AppTheme').
- Error:No resource found that matches the given name (at 'icon' with value '@mipmap/ic_launcher.9').
- Error:(26, 34) No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/b
- Error: No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/p
- error: Error: No resource found that matches the given name (at 'text' with value '@string/
- AndroidManifest.xml:10: error: Error: No resource found that matches the given name (at 'icon' with
- 布局文件XML编译报错 no resource found that matches the given name(at layout_above with value ...)
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/ history_child_
- 找不R文件切且报 no resource found that matches the given name(“at ' layout_above ' with value ' @id/text_p'
- No resource found that matches the given name (at 'layout_above' with value '@id/butt
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_friend
- No resource found that matches the given name (at 'drawab' with value '@drawable/你的资源').
- No resource found that matches the given name (at 'layout_toLeftOf' with value '@id/tx_search_frien
- 怎样解决错误:error: Error: No resource found that matches the given name (at 'layout_toLeftOf' with value
- Error retrieving parent for item: No resource found that matches the given name 'android:TextAppeara
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Wind
- Android开发中error: Error retrieving parent for item: No resource found that matches the given name解决方法