Create signed bundle release. Error: Android resource linking failed
Asked Answered
E

5

5

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.

Excessive answered 7/8, 2022 at 14:38 Comment(0)
E
-1

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
Excessive answered 28/8, 2022 at 8:16 Comment(1)
I believe it should be res -> mipmap in Step 1. Also, I believe in most users' situations, and the original posters', they don't have multiple or misnamed ic_launcher files.Munificent
A
6

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

Arman answered 15/11, 2022 at 14:53 Comment(3)
can u help me to solve the issue https://mcmap.net/q/2031203/-detecting-which-sim-a-incoming-call-is-coming-from-android/5197712Flat
@Anand I had answered similar post did you checked it .. did it worked ?Arman
it works, it might be a bug Android StudioNovelize
D
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

Dani answered 23/11, 2022 at 5:52 Comment(0)
I
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 ! ;)

Implacental answered 30/9, 2022 at 8:24 Comment(0)
K
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.

Kirbykirch answered 8/8, 2022 at 0:12 Comment(1)
Thanks for the answer. But When I choose debug they are builded normally. And I've added a resource image for you to see.Excessive
E
-1

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
Excessive answered 28/8, 2022 at 8:16 Comment(1)
I believe it should be res -> mipmap in Step 1. Also, I believe in most users' situations, and the original posters', they don't have multiple or misnamed ic_launcher files.Munificent

© 2022 - 2024 — McMap. All rights reserved.