Sunday, November 27, 2011

AndroidManifest.xml has the error "No resource found that matches the given name (at 'icon' with value '@drawable/icon')." for the application tag.

AndroidManifest.xml has the error "No resource found that matches the given name (at 'icon' with value '@drawable/icon')." for the application tag (highlighted in red color below)

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

I have faced the issue for multiple times. I have found 2 reasons for this error.
1) icon.png is not present in the drawable-hdpi folder inside res folder of Android project.
2) Android application is not able to find the icon.png file.

Solution

1) Make sure that icon.png (or whatever files mentioned in the <application android:icon tag) is present in the drawable-hdpi folder inside res folder of Android project.

2)If it shows the error even if the icon.png is present,then remove the statement <application android:icon from the AndroidManifest.xml and add it again.

2 comments:

  1. Yes, you are right and thanks much. This fixes the "R." is not resolvable error. Three toots to you.

    ReplyDelete

Resolve "Target runtime Apache Tomcat v6.0 is not defined." error

Go to window ->preferences ->Server->Runtime environments . add server Apache Tomcat v6.0 Mention the directory where apache-toma...