androidandroid-studioiconsandroid-iconsandroid-asset-studio

Android resource linking failed - How to solve it?


I recently changed the icon of my app. When I run the app using USB debugging on my phone, everything is fine, the app compiles and the icon is as it should be. But as soon as I try to generate a signed APK, the compilation ends with this error:

A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction

Android resource linking failed C:\Users\Adam\AndroidStudioProjects\Generator\app\build\intermediates\packaged_manifests\release\AndroidManifest.xml:11: error: resource mipmap/ic_launcher not found.

Which is strange because otherwise everything works and the xml file is where it's supposed to be. I created the icons using Image Asset and they generated correctly. The only thing that comes to me as a possible cause is that for ic_launcher there is only an xml file, but ic_launcher_round has a whole folder with png images as well. Also, in the manifest there is a preview of the icon only for the round version, it is not loaded for the regular version:

enter image description here

How can I solve this?


Solution

  • Solved, it was enough to select the icon as res directory: main when confirming the path:

    enter image description here