Build Fail Android app:mergeReleaseResources

Managed Workflow
eas-cli = 0.54.1

When I run this cmd eas build -p android --profile preview

I get this error

> Task :unimodules-task-manager-interface:generateReleaseResValues
> Task :unimodules-task-manager-interface:generateReleaseResources
> Task :unimodules-task-manager-interface:packageReleaseResources
> Task :app:mergeReleaseResources FAILED
[stderr] 
FAILURE: Build failed with an exception.
[stderr] 
* What went wrong:
[stderr] 
Execution failed for task ':app:mergeReleaseResources'.
[stderr] 
> Multiple task action failures occurred:
[stderr] 
   >
[stderr] 
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
[stderr] 
      > Android resource compilation failed
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.
[stderr] 
            
[stderr] 
        /home/expo/workingdir/build/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: AAPT: error: file failed to compile.
[stderr] 
            
[stderr] 
* Try:
[stderr] 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
[stderr] 
* Get more help at https://help.gradle.org
[stderr] 
BUILD FAILED in 5m 15s
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
168 actionable tasks: 168 executed
Error: Gradle build failed with unknown error. Please see logs for the "Run gradlew" phase. 

Any idea what I can do to fix this problem? Just trying to make an apk.

Looks like, you are using a corrupt or invalid .png file for the app icon that is generated in mipmap-mdpi directory. Can you please re-check that PNG file? Maybe it was a JPG before and wasn’t converted to PNG in a successful manner.

Okay when I check my directory it finds the mipmap-mdpi folder here "C:\Users\osain\Coding\Projects\vthwritings\node_modules\react-native\template\android\app\src\main\res\mipmap-mdpi"

When I open this folder I find the png files, they are not jpgs. But it is strange though because I do not meddle with anything in node modules folder directly. Do you know what else could be the issue?

image

Just to confirm, do you have a customized app icon in the /assets directory?

Hi @oiver55

Those are not the ones it’s complaining about. It’s complaining about the app icon(s) you’ve specified in app.json

The message is confusing because during the build process your icons are renamed to “ic_launcher.png” etc.

See the code here

1 Like

Wow I didn’t realize my it was my app icons that had to be .png lol. Such a simple fix. Thank you!

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.