0

Error : No resource found that matches the given name (at 'icon' with value '@drawable/icon').

This is my manifest... I'm extremely new to this, just started this morning and have no previous programming experience. Also, extremely sorry for post code formatting, i'm really bad at this.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.asdf"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
<application android:label="@string/app_name" android:icon="@drawable/icon">
<activity android:name="ExampleActivity"
      android:label="@string/app_name">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
PositivityRiven
  • 289
  • 2
  • 4
  • 4
  • @Fllo I have the drawable, and it is showing fine in the design view of my layout. Yet, I still get the error! What should I do? – Ruchir Baronia Dec 13 '15 at 04:28

4 Answers4

2

you have two application tags in your manifest. get rid of this part:

</application>
<application android:label="@string/app_name" android:icon="@drawable/icon">

After that. If you are trying to use your own icon, put your icon in the drawable folder, and replace:

android:icon="@drawable/ic_launcher"

with:

android:icon="@drawable/your_icon"
ILovemyPoncho
  • 2,762
  • 2
  • 24
  • 37
2

Yet another Googlemare Landmine.... Somehow, if you mess up, the icon line on your .gen file dies. (Empirical proof of mine after struggling 2 hours)

Insert a new icon 72x72 icon on the hdpi folder with a different name from the original, and update the name on the manifest also.

The icon somehow resurrects on the Gen file and voila!! time to move on.

Josh
  • 6,251
  • 2
  • 46
  • 73
  • I had to put an `icon.png` in the `drawable-hdpi` folder. Thank you for the help. – redolent Dec 01 '15 at 00:10
  • I have the drawable, and it is showing fine in the design view of my layout. Yet, I still get the error! What should I do? I also don't have an hdpi folder. It was working fine before I replaced one of the images... – Ruchir Baronia Dec 13 '15 at 04:29
  • I suggest you create a folder called "drawable-hdpi" inside "res". You can insert the same icon again in there, but with a different name, and use it in your code. @RuchirBaronia – Josh Dec 13 '15 at 10:39
0
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.asdf"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="19" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/icon"   
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity 
            android:name="ExampleActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Make sure you put your icon.png in drawable folders.

(96x96 in xhdpi, 72x72 in hdpi, 48x48 in mdpi)

V-rund Puro-hit
  • 5,518
  • 9
  • 31
  • 50
ajinkya
  • 129
  • 6
0

first time I Creates my app in one of my drives that have bitLocker. but second time I creates that in my system drive(c).and now every thing is ok. I fix it :) you can do this...