Android: empty white screen after BundleDownloader failure #32898
Labels
Needs: Triage 🔍
Platform: Android
Android applications.
Resolution: Locked
This issue was locked by the bot.
Tech: Bundler 📦
This issue is related to the bundler (Metro, Haul, etc) used.
Description
In development mode on Android, if the app has no JS bundle and no fallback available, the app displays a RedBox error saying either
Unable to load script.
orCould not connect to development server.
. If the user resolves this issue and choosesReload
, the app will then successfully download the bundle from Metro, but will not actually initialize the application. Instead, the app simply shows a blank white screen.Here's the series of steps that causes this to happen:
runCreateReactContextOnNewThread
is called as part of normal React Native initializationmCreateReactContextThread
thread is created and startedcreateReactContext
throws an exception; this is what triggers the RedBoxReload
, which causesBundleDownloader
to download the bundleBundleDownloader
'sonSuccess
callback callsrecreateReactContextInBackground
recreateReactContextInBackground
sees thatmCreateReactContextThread
was already set earlier, and thus setsmPendingReactContextInitParams
mPendingReactContextInitParams
is never used and the app sits idleI have a proposed fix that I'll send a PR for.
Version
0.66.4
Output of
npx react-native info
Steps to reproduce
npx react-native init
yarn android
to build and launch the app in your emulatoryarn start
Reload
to load the bundle from MetroSnack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: