1

I am trying to release apk in react native but getting this error task :app:mergereleaseresources failed

If I delete the drawable and raw folder and build again then I am getting this error

Task :app:processReleaseResources

Process to generate apk in react native

  1. Create keystore

  2. 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/

  3. cd android

  4. ./gradlew assembleRelease

Plz help me

Pooja
  • 543
  • 7
  • 26
  • navigate to the android directory and then run `npx jetify` after running the following command run the above steps for generating apk. – daksh bhardwaj Aug 04 '22 at 10:42
  • Ok, I will check that – Pooja Aug 04 '22 at 10:53
  • Duplicate Resource found error – Pooja Aug 04 '22 at 10:56
  • I think your `mergeReleaseResource` issue is solved now, For the duplicate resources issue navigate to the` app/build.gradle` and check if `project.ext.react = [ bundleInRelease: false ]` `bundleInRelease` is false. after that run `rm -rf ./android/app/src/main/res/drawable-* rm -rf ./android/app/src/main/res/raw` after that try to make the apk. – daksh bhardwaj Aug 04 '22 at 11:45
  • Removing drawable-* makes other errors happen as well, because they are not founded. – TalesMGodois May 15 '23 at 17:58

1 Answers1

6

Navigate to the android folder and run

npx jetify

this will solve your mergereleasesource issue.

after that, if you are facing a duplicate resource issue then run the following command

rm -rf ./android/app/src/main/res/drawable-*
rm -rf ./android/app/src/main/res/raw 
daksh bhardwaj
  • 315
  • 4
  • 12