Error while trying to build an APK file for React Native project

Viewed 1003

**Task :app:mergeReleaseResources FAILED FAILURE: Build failed with an exception.

  • What went wrong:** Execution failed for task ':app:mergeReleaseResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource compilation failed \mobile\flyfoot2\android\app\build\generated\res\react\release\drawable-mdpi\assets_images_nour.png: AAPT: error: failed to read PNG signature: file does not start with PNG signature.

 \mobile\flyfoot2\android\app\build\generated\res\react\release\drawable-mdpi\assets_images_nour.png: AAPT: error: file failed to compile.
3 Answers

Delete All drawable dir

rm -rf android/app/src/main/res/drawable-*

& also change the formate of Your Image

Then Try to generate Again, Hope your Problem will solve.

You Using splash screen in java file. and the splash screen image maybe.. ".png" file. so just change the file name ".png" to ".jpg".....

main background in splash screen should be in .jpg...

//this will help you to Removing error

You are facing this error because some of your Icons or Images are not in the PNG extension. Make sure all of your Icons and Images are in PNG.

Related