react-native-splash-screen
react-native-splash-screen copied to clipboard
Native module SplashScreen tried to override SplashScreenModule. Check the getPackages() method in MainApplication.java.
Run react-native info
in your project and share the content.
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
Memory: 1.40 GB / 15.84 GB
Binaries:
Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK: Not Found
Windows SDK: Not Found
IDEs:
Android Studio: Version 4.1.0.0 AI-201.8743.12.41.7042882
Visual Studio: Not Found
Languages:
Java: Not Found
Python: Not Found
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.4 => 0.63.4
react-native-windows: Not Found
npmGlobalPackages:
react-native: Not Found
What react-native-splash-screen
version are you using?
v3.2.0
What platform does your issue occur on? (Android/iOS/Both)
Currently on Android
packages.add(new MyReactNativePackage()); you can try removing this line.
In my case I had to remove
packages.add(new SplashScreenReactPackage());
I can only assume that it is auto inlined and it did not need to be added manually.
In my case I'm using the lib react-native-bootsplash
but the error that I got was the same. I removed the manual link I did, described here. One of the steps from the manual link was to add this line packages.add(new RNBootSplashPackage());
in MainApplication.java
so I pretty much did the same thing @ZoranRavic did, removed that line and the other steps from manual link and then my app started working again.
remove packages.add(new SplashScreenReactPackage());
packages.add(new MyReactNativePackage()); you can try removing this line.
It worked thanks, but I have a question why the documentation says to add this package in MainApplication.java/kt even if it can work without this line of code.