1
votes

While creating the signed apk in react native android, I'm getting below error in the final step

Execution failed for task ':app:processReleaseResources'. Failed to process resources, see aapt output above for details.

Task :app:processReleaseManifest C:\React\android\app\src\main\AndroidManifest.xml:13:5-42:19 Warning: application@android:allowBackup was tagged at AndroidManifest.xml:13 to replace other declarations but no other declaration present

C:\React\android\app\build\intermediates\res\merged\release\drawable-hdpi\node_modules_reactnavigation_src_views_assets_backicon.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays.

Any helps will be appreciated.

3

3 Answers

0
votes

First Bundle the react-native code with android in the command line

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

After successful completion of bundling then go to android studio and clean the project. If no error occurs then generate signed apk through Build->Generate Signed APK.

Change the name for the entry file at --entry-file to the one which you are using.

0
votes

Set as below in the gradle.properties file:

android.enableAapt2=false

Now sync gradle.

If still not fixed, manually delete all the build folders in the project and reassemble.

0
votes

FIRST: Execution failed for task ':app:processReleaseResources'. Failed to process resources, see aapt output above for details. => can fix by @Saravanan mentioned. SECOND: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.. error: failed parsing overlays. => can fix by @sdn404 mentioned. THIRD: If you still have any issue, try to replace android.enableAapt2=false with org.gradle.configureondemand=true then run command cd android && ./gradlew clean then ./gradlew assembleRelease Hope this help.