react-native-splash-screen
react-native-splash-screen copied to clipboard
this setup is for java now the android file is converted to kotlin, can anyone share the setup for kotlin
Run react-native info in your project and share the content.
What react-native-splash-screen version are you using?
What platform does your issue occur on? (Android/iOS/Both)
Describe your issue as precisely as possible :
- Steps to reproduce the issue or to explain in which case you get the issue
- Interesting
logs
Join a screenshot or video of the problem on the simulator or device?
Show us the code you are using?
@nawazokz I recommend you to use BootSplash it currently supports the new react native architecture.
package com.turtlebuddy import android.os.Bundle; import com.facebook.react.ReactActivity import com.facebook.react.ReactActivityDelegate import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled import com.facebook.react.defaults.DefaultReactActivityDelegate // react-native-splash-screen >= 0.3.1
import org.devio.rn.splashscreen.SplashScreen;
class MainActivity : ReactActivity() {
/**
- Returns the name of the main component registered from JavaScript. This is used to schedule
- rendering of the component.
*/
override fun onCreate(savedInstanceState: Bundle?) {
SplashScreen.show(this);
super.onCreate(null) }
override fun getMainComponentName(): String = "turtleBuddy"
/**
- Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
- which allows you to enable New Architecture with a single boolean flags [fabricEnabled] */ override fun createReactActivityDelegate(): ReactActivityDelegate = DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) }
Facing the Same Issue, the Splash Screen [react-native-splash-screen] is not Working, Just because of kotlin Issue,
Check the following comment, it solved the issue and the example provided for Kotlin
https://github.com/crazycodeboy/react-native-splash-screen/issues/638#issuecomment-2020896542
Does anyone have an idea how to solve it? I need this fix
https://github.com/crazycodeboy/react-native-splash-screen/issues/639#issuecomment-1965855871 try this solution it work for me
https://github.com/crazycodeboy/react-native-splash-screen/issues/639#issuecomment-1965855871 try this solution it work for me just paste these line of code under class MainActivity : ReactActivity() the line is override fun onCreate(savedInstanceState: Bundle?) { SplashScreen.show(this); // add this super.onCreate(null) }
#639 (comment) try this solution it work for me
i build success but it crash when open app on android 8
The readme docs needs to be updated please