Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Android staging build crashes on startup

Tags:

react-native

I have added 2 more buildTypes in my build.gradle file staging & prestaging alongside with release. When I build and run the release buildType it works fine on the real device, but when I build and run staging or prestaging builds both crashes on startup. The crash report on the device shows the following error: enter image description here

All the builds work without any issue on iOS

like image 995
Ajay Sivan Avatar asked Sep 03 '25 04:09

Ajay Sivan


1 Answers

My staging and prestaging build failed because the bundle were not packaged correctly as the error says. This is because when building Android app react-native only add the bundle to the package if the buildType name contains the word release. The simple solution for this is to name the buildType's in such a way that the names contain the word release. I renamed the buildType's to stagingRelease and prestagingRelease.

like image 128
Ajay Sivan Avatar answered Sep 05 '25 00:09

Ajay Sivan