Splash Screen gets stuck when using multiple bundles
See original GitHub issueBug report
Summary
When using another library like react-native-threads, the splash screen will show up (and get stuck) every time a new worker is spawned.
I assume this is happening because the worker is actually a new bundle instance being created in the background, and perhaps the code that checks for development reload is thinking that the worker is actually a reload.
I assume this is a problem with both iOS and Android, however, I’m only able to use the first platform at the moment.
Environment info
react-native info
output:
BUNDLE ./index.js <--- splash screen hides normally
LOG Arguments [49, [49, 54, 49, 54, 57, 57, 51, 54, 57, 56, 48, 56, 49]]
LOG Running "myapp" with {"rootTag":1,"initialProps":{}}
BUNDLE ./worker.js <-- splash screen comes back as soon as a worker is spawned.
BUNDLE ./worker.js
BUNDLE ./worker.js
BUNDLE ./worker.js
Library version: 3.2.0
Steps to reproduce
- Use any library that spawns multiple bundles for multiprocessing (like the one I’m using).
- The splash screen will hide for a quick second and will immediately come back after the worker has been spawned (and it will be stuck).
Describe what you expected to happen:
- The splash screen should come up and hide only in the root bundle (eg. BUNDLE ./index.js).
- The splash screen should not interact with different bundle names (that is: BUNDLE ./index.js != BUNDLE ./worker.js).
Reproducible sample code
Just run the usage code after installing react-native-threads and hiding the splash screen for the first time (a setTimeout helps in making sure you see the hiding animation, but not necessary).
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
uploaded app bundle but app is stuck on splash screen
issue: I developed an app that works fine in the development environment. Then I ran expo build:android --type app-bundle , allowed the ...
Read more >Expo react-native app suddenly stuck on Splash Screen
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle...
Read more >flutter_native_splash | Flutter Package - Pub.dev
Customize Flutter's default white native splash screen with background color and splash image. Supports dark mode, full screen, and more. ... When your...
Read more >Expo Stuck on Splash Screen - Jorge Colon Consulting
So I thought maybe there was some caching weirdness going on with Expo, so I tried clearing the bundler cache, but that didn't...
Read more >expo-splash-screen - npm
By using this resize mode your app will will leverage Android's ability to present a static bitmap while the application is starting up....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved the problem.
For some reason had the
[RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
line before the[self.window makeKeyAndVisible];
and it somehow worked on the 3.2.0 version and was breaking on 3.2.3. Followed the docs & it worked.Sorry for misleading you @zoontek!
I can confirm that 3.2.3 fixes this! Also, @vrazn I think that the docs might have changed that recently because we had the same situation with the order of operations as you did.
So, to anybody reading this in the future:
AppDelegate.m
code is the same as @vrazn 's suggestion.