4

I am a beginner in java android.

The following error occurs when releasing Java project "Create signed bundle" in Android Studio (When I choose debug they are builded normally):

I searched for a solution on google search engine and stackoverflow. None of the provided answers helped solve this problem.

Android resource linking failed
C:\Users\user\AndroidStudioProjects\Door\app\build\intermediates\packaged_manifests\release\AndroidManifest.xml:22: error: resource mipmap/ic_launcher (aka com.example.door:mipmap/ic_launcher) not found.
C:\Users\user\AndroidStudioProjects\Door\app\build\intermediates\packaged_manifests\release\AndroidManifest.xml:22: error: resource mipmap/ic_launcher_round (aka com.example.door:mipmap/ic_launcher_round) not found.
error: failed processing manifest.

Androidmanifest.xml

...
<application
    android:allowBackup="true"
    <!--When I delete these two lines, the build ends successfully.-->
    android:icon="@mipmap/ic_launcher"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:label="@string/app_name"
    android:requestLegacyExternalStorage="true"
    android:supportsRtl="true"
    android:theme="@style/Theme.Door">
 ...

enter image description here

Thanks in advance.

Mawon
  • 71
  • 1
  • 6

5 Answers5

4

I just found a solution ...

Go to your project folder you will see like this ..

enter image description here

Note You will only have debug folder. So create new folder called release and copy everything that is in debug folder and generate apk now it will work

Thanks

AgentP
  • 6,261
  • 2
  • 31
  • 52
3

What worked for me and I am sure will work for you is, When creating the image or vector assets in android studio, It asks whether you want it for the Debug, Release or Main in the drop down. Select the Release and clean project followed by the Build aap or apk for the Release version. Refer to this screen shot

1

Had the same problem, it's actually stated in your error message but it's unclear :

It's trying to search for the icon files in the release folder, however it may not be the folder where you've put your icons before clicking on finish on the Image Asset window.

You need to do the following : Make sure you're selecting "release" as the Res directory for your icon.

As I'm not an expert yet and wanted to be sure the icon would also be loaded when debugging on my phone on USB, I added it twice : once with main as the res directory and another time with release to be able to create my signed bundle.

However, once in release folder might be enough, didn't tried it yet, I just solved the problem and wanted to share a solution.

Hope I could help ! ;)

Lineaum
  • 21
  • 2
0

From memory only (I'm not at my dev computer), the resource paths for the icons are generated incorrectly, i.e. they are not actually at @mipmap. Check in Android Studio where the resources actually are (under which folder?) and then update AndroidManifest.xml appropriately.

AndrWeisR
  • 1,110
  • 11
  • 21
  • Thanks for the answer. But When I choose debug they are builded normally. And I've added a resource image for you to see. – Mawon Aug 08 '22 at 06:43
0

I found solutions. To fix this error. Need to do:

  1. Project -> app -> res -> minmap press the right mouse button;
  2. In the New -> Image Asset menu that appears;
  3. In "Name" will change "ic_launcher2" to "ic_launcher";
  4. In "Path" reselect the original Image file: enter image description here
Mawon
  • 71
  • 1
  • 6