Fixed - React native sentry release build failed bundleReleaseJsAndAssets_SentryUpload_1
July 18, 2021
React native sentry release build failed:
After sentry was added, it was giving a build error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets_SentryUpload_1'.
Even after cleaning the build, it was throwing the same error.
Solution:
It was fixed with the below command:
./gradlew assembleRelease -x bundleReleaseJsAndAssets
This is a gradle command. So, you need to move inside the android folder to execute it.
cd android && ./gradlew assembleRelease -x bundleReleaseJsAndAssets
Similarly, you can try the below command to create the aab file:
./gradlew bundleRelease -x bundleReleaseJsAndAssets
Add it to package.json script:
You can also add this build command to your package.json file.
"androidRelease": "cd ./android && ./gradlew app:assembleRelease -x bundleReleaseJsAndAssets"
Now, you can run it using yield or npm.