Android App Crashing on Open
See original GitHub issueFor anyone with this issue I spent a bit of time trying to figure out how to solve it. This library works well for me on ios and I didn’t want to have two different libraries for the different operating systems.
If you are having this issue, in MainActivity.java:
instead of
SplashScreen.show(this);
use
SplashScreen.show(this, true);
The problem is in the supporting Java file, SplashScreen.java. This is the default call which calls another method called show(final Activity activity, final boolean fullScreen).
public static void show(final Activity activity) { show(activity, false); }
Because it calls it with ‘false’, the second style is used which React Native can’t figure out and it crashes. on line ~31 `mSplashDialog = new Dialog(activity, fullScreen ? R.style.SplashScreen_Fullscreen : R.style.SplashScreen_SplashTheme);’
If you just call show(final Activity activity, final boolean fullScreen) directly with ‘true’ as the second argument, it should be able to figure out the first style and it will work.
Please update the documentation
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:61 (1 by maintainers)
Top GitHub Comments
Yes, adding “android/app/src/main/res/values/colors.xml” solved the problem. Just add a “primary_dark” value to the file like this.
crashing even after changing to SplashScreen.show(this, true);