not work at react-native 0.61.4
See original GitHub issueRun react-native info
in your project and share the content.
React Native Environment Info:
System:
OS: Windows 10
CPU: (20) x64 Intel® Xeon® CPU E5-2660 v2 @ 2.20GHz
Memory: 3.98 GB / 15.93 GB
Binaries:
Yarn: 1.19.1 - C:\Users\Administrator.SC-201910230934\AppData\Roaming\npm\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
What react-native-splash-screen
version are you using?
3.2.0
What platform does your issue occur on? (Android/iOS/Both)
Android
Describe your issue as precisely as possible :
The react-native 0.61.4 migrates onCreate function to MainApplication.java。
Show us the code you are using?
MainApplication.java:
import org.devio.rn.splashscreen.SplashScreenReactPackage; //<–添加这一句 import org.devio.rn.splashscreen.SplashScreen;//<–添加这一句 import android.os.Bundle; // <–添加这一句 @Override protected List<ReactPackage> getPackages() { @SuppressWarnings(“UnnecessaryLocalVariable”) List<ReactPackage> packages = new PackageList(this).getPackages(); packages.add(new SplashScreenReactPackage());//<–添加这一句
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return packages;
}
@Override public void onCreate() { super.onCreate(); SplashScreen.show(this);//<–添加这一句 SoLoader.init(this, false); initializeFlipper(this); // Remove this line if you don’t want Flipper enabled }
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:16
Top GitHub Comments
Use this package, way better, just saying to increment its visibility (it’s not mine) because I believe that the good work, and the effort that it requires, must be paid off somehow 😃
https://github.com/zoontek/react-native-bootsplash
oh good, so instead of promoting the right one, we should keep using the broken ones. Clearly I didn’t know that in 0.61.4 it’s still working considering that the last commit was in April and that a lot of people (the author of this and the other 4 guys that liked the first comment plus many other issues) reported the packages as broken.