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

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.

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

Solution 1:

Found this question. I was importing an old project into android studio and got the error.

The issue was eventually answered for me here mipmap drawables for icons

In the manifest it has

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
...

but @drawable has been superseded by @mipmap so needed changing to:

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
...

I put this answer here, as it may become a more common issue.

Solution 2:

What solved the problem for me was - create a folder "drawable" in "..platforms/android/res/" and put "icon.png" in it.

Solution 3:

If you are 100% sure that directories and files are ok, have a look at the project location.

There is a limit on the path length of files in the Operating System. Perhaps this limit is being exceded in your project files.

Move the project to a shorter folder (say C:/MyProject) and try again!

This was the problem for me!

Solution 4:

I've spent on this problem much time and as for me (for Intellij IDEA) the solution is to specify right path to res directory:

  • right click on project
  • click Modules in the left panel
  • select Android below your project name
  • in Structure tab set right path.

And don't forget to check all the paths in this tab!

I hope it will be helpful for somebody!