7

Using cordova build on a one-year-old project raises:

:processDebugResources
my_project/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/icon').

And then crushes:

FAILURE: Build failed with an exception.

Any idea?

Michael
  • 3,206
  • 5
  • 26
  • 44

4 Answers4

7

I got the same problem and I solved this by re generating icon paths, try this

ionic resources --icon

after this use below command

ionic build
Amitabh Sarkar
  • 1,281
  • 1
  • 13
  • 26
  • you have to add that the should be a valid icon.png in the resources/ folder. For some reason mine was gone and this didn't work for me initially – Chisko Jul 22 '16 at 03:10
  • Yes you have to add icon file with the name of "icon" in the resource folder before running above command, icon file can be in icon.psd ,png or other common image format. – Amitabh Sarkar Apr 21 '17 at 04:30
1

In your manifest, does it have:

    android:icon="@drawable/ic_launcher"

If so, you can try switching it to:

    android:icon="@mipmap/ic_launcher"

It seems that @drawable has been superseded by @minimap. More info can be found here and here. Hope this helps.

Community
  • 1
  • 1
Chewpers
  • 2,430
  • 5
  • 23
  • 30
  • Thanks, but it is not `drawable/ic_launcher` but `drawable/icon`. BTW the manifest was created by `cordova platform add android`. – Michael Jan 18 '16 at 20:17
  • did not work and even caused the app to crash after fixed – Chisko Jul 22 '16 at 03:15
  • This was the solution for me as well. A project that was updated from pre CLI 6.0 to CLI 6.4 and Android platform 6.1.2. Had "@drawable/icon" and switching to mipmap cleared the build issue and the app installed and is running normally. – Brad L. Sep 01 '17 at 21:42
1

There is debug option -d in the cli run the below command to check what is the problem,

cordova -d --stacktrace build android
Renjith Thankachan
  • 4,178
  • 1
  • 30
  • 47
0

copy valid png to resources\android\icon.png

and then run

ionic resources --icon

user24251
  • 1
  • 2