White screen in release
Error text
App opens to a blank white or black screen; logcat: Unable to load script. Make sure you're either running Metro or that your bundle 'index.android.bundle' is packaged correctly for release.
Cause
The app opens but the screen stays blank. The JS bundle did not get packaged, or a JS error happened on the first render.
Step-by-step fix
- Search
adb logcatforUnable to load scriptor a JS error. - Check that the bundle file exists at
assets/index.android.bundle. - Create the bundle by hand and run
./gradlew clean assembleRelease. - If a JS error blanks the screen, wrap the first screen with
try/catchand anErrorBoundary. - If your API address is
http, read the network security config page.
Example commands
adb logcat *:E | grep -i -E "react|bundle|script" npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res cd android && ./gradlew clean assembleRelease
How to prevent it
Before every release install the APK on a phone without any debug tooling and open it.
Author and license: Nibras Code
- APK will not install
- What is a parse error?
- The keystore is lost
- The signatures do not match
- Package name error
- The APK file is damaged
- Play Protect blocks the app
- The package appears to be invalid
- Not enough storage
- The phone is not compatible
- An older version will not install
- XAPK will not install
- Gradle sync failed
- Could not resolve a dependency
- Duplicate class error
- Manifest merger failed
- Dex limit: 65536 methods
- R8: Missing class
- JDK version mismatch
- SDK location not found
- minSdkVersion conflict
- compileSdk is too low
- EAS build: Gradle failure
- expo prebuild error
- Metro: Unable to resolve module
- Hermes: JS error only in release
- Red screen: cannot reach Metro
- Expo SDK mismatch
- Capacitor sync error
- Capacitor: white screen
- EAS: keystore and credentials error
- Keystore was tampered with / wrong password
- Wrong key alias or password
- Play: signed with the wrong key
- INSTALL_FAILED_UPDATE_INCOMPATIBLE
- INSTALL_FAILED_VERSION_DOWNGRADE
- INSTALL_FAILED_INSUFFICIENT_STORAGE
- INSTALL_FAILED_NO_MATCHING_ABIS
- Parse error (problem parsing the package)
- "App not installed" error
- Installing an AAB file on a phone
- adb: device "unauthorized"
- adb: device not found
- adb server version mismatch
- Activity class does not exist
- Play: targetSdk level too low
- Play: permissions policy rejection
- Play: 64-bit requirement
- Play: versionCode already used
- ClassNotFound / NoSuchMethod crash
- OutOfMemoryError crash
- CLEARTEXT communication not permitted
- SecurityException: permission denied