Skip to content

Splash screen doesn't disappear #71

Open

Description

@aleksandr-senichev

"react-native": "0.44.0",
"react-native-splash-screen": "^2.1.0",

It works fine so far (no updates, nothing new), but splash screen now doesn't disappear, no error in build. If I remove [Splashscreen show] from the AppDelegate.m file it works, but I want to have some delay. What it could be? It just stopped working, and if I even get back to my previous commits, it still no effect. Could it be problem with my OS or simulator? I don't yet check on real device.

class AppWithNavigationState extends Component {
  componentDidMount() {
    setTimeout(() => {
      SplashScreen.hide();
    }, 2000)
  }

  render() {
    return (
      <Index
        navigation={addNavigationHelpers({
          dispatch: this.props.dispatch,
          state: this.props.nav
        })}
      />
    )
  }
}

Activity

  1. sayhei commented on Aug 1, 2017

    @sayhei

    mee too,the error message
    Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x124c2ecc0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x124a456f0). One of the two will be used. Which one is undefined.

  2. emin93 commented on Aug 15, 2017

    @emin93

    Out of curiosity, are you using the wix navigator (react-native-navigation)?

  3. Gp2mv3 commented on Aug 16, 2017

    @Gp2mv3

    @emin93 I just switched to react-native-navigation and it started to bug... Do you have a solution ?

  4. hustlerism commented on Aug 17, 2017

    @hustlerism

    Same thing happened to me on Android.

    componentWillMount () {
            SplashScreen.show();
        }
    
        componentDidMount () {
            SplashScreen.hide();
        }
    

    Any solution for this?

  5. fmoessle commented on Sep 2, 2017

    @fmoessle

    same for me on android, and I am using wix navigation

  6. hustlerism commented on Sep 4, 2017

    @hustlerism

    I managed to solve this issue by removing

    SplashScreen.show()

  7. Gp2mv3 commented on Sep 4, 2017

    @Gp2mv3

    I did the same but then the splashscreen never shows...

  8. romanglom commented on Sep 24, 2017

    @romanglom

    Anyone figured out how to fix it?
    I have the same problem in Android.

    "react-native": "^0.47.0",
    "react-native-splash-screen": "^3.0.1",

    And I'm also using react-native-navigation from wix.

  9. 6axter82 commented on Nov 24, 2017

    @6axter82

    I am having just exactly the same problem as @Ralcon described. Any improvements on this issue?
    The app is working on Android but on iOS it just stoped at this stage.

  10. aditya-simplecrm commented on Dec 18, 2017

    @aditya-simplecrm

    Any solution?

  11. aditya-simplecrm commented on Dec 18, 2017

    @aditya-simplecrm

    If I add the splash screen through LaunchScreen.xib then this library works like a charm.
    But if I add splash screen images in Images.xcassets then splash screen is not hiding.

  12. 6axter82 commented on Dec 18, 2017

    @6axter82

    Did you have a look in #87?

  13. cihadturhan commented on Apr 25, 2018

    @cihadturhan

    android, v3.0.6 with react-native v0.54.4.
    Sometimes splash screen stays forever, although I explicitly call SplashScreen.hide()

  14. wincod75 commented on May 18, 2018

    @wincod75

    So, I had the same exact issue, this is how I fixed it. Seems a bit glitchy in my emulator, will test on actual device.

    change -> DidMount to -> WillMount

    componentWillMount() {
    SplashScreen.hide();
    }

    "react": "^16.3.2",
    "react-native": "^0.55.4"

  15. 12 remaining items

  16. Jyrno42 commented on Mar 28, 2019

    @Jyrno42

    Make sure to call SplashScreen.show before the call to super.onCreate, e.g this worked for me:

    public class MainActivity extends NavigationActivity {
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		SplashScreen.show(this);
    
    		super.onCreate(savedInstanceState);
    	}
    }
    

    while these resulted in empty white screen after call to SplashScreen.hide:

    public class MainActivity extends NavigationActivity {
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    
    		SplashScreen.show(this);
    	}
    }
    
    public class MainActivity extends NavigationActivity {
    	@Override
    	protected void addDefaultSplashLayout() {
    		SplashScreen.show(this);
    	}
    }
    
  17. rochapablo commented on May 24, 2019

    @rochapablo

    This is not the first time that I had this issue. So this message it's for myself in future;

    To fix on iOS make sure that [RNSplashScreen show]; is the last thing before return YES;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      ...
      
      [RNSplashScreen show];
      
      return YES;
    }
    
  18. kumarutsav111 commented on Jun 13, 2019

    @kumarutsav111

    Having the same problem with react-navigation.
    This only happens in the release build.

    I am also facing the same issue as you like in release build splash screen hangs and not moving to next screen. Any solutions ?

  19. KristineTrona commented on Jun 20, 2019

    @KristineTrona

    Same issue here - in debug build it works just fine, but on release stays stuck

  20. eai301 commented on Jul 3, 2019

    @eai301

    1+

  21. bernhardt1 commented on Jul 3, 2019

    @bernhardt1

    The issue for me is unpredictable. None of the behavior seems to make sense but here is what I'm seeing ->

    • Uninstalling the app can fix the problem for a short period.
    • Making any changes to the hiding/showing of the splash screen seems the break it again. (uninstall and reinstall fixes it)

    I haven't tried a release build yet.

  22. Vahn84 commented on Aug 1, 2019

    @Vahn84

    This is not the first time that I had this issue. So this message it's for myself in future;

    To fix on iOS make sure that [RNSplashScreen show]; is the last thing before return YES;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      ...
      
      [RNSplashScreen show];
      
      return YES;
    }
    

    This is the correct fix for iOS

  23. ckOfor commented on Oct 24, 2019

    @ckOfor

    This is not the first time that I had this issue. So this message it's for myself in future;

    To fix on iOS make sure that [RNSplashScreen show]; is the last thing before return YES;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      ...
      
      [RNSplashScreen show];
      
      return YES;
    }
    

    This is the fix for iOS :) thanks @rochapablo

  24. edu1525 commented on May 17, 2020

    @edu1525

    In Android I used a Handler to Hide Splash inside native code after 2,5 seconds, so there's no need to hide splash with Javascript. I know this is not the best solution but its working. Inside the onCreate method of the MainActivity put a handler like this:

    @Override protected void onCreate(Bundle savedInstanceState) { SplashScreen.show(MainActivity.this); super.onCreate(savedInstanceState); new Handler().postDelayed(() -> SplashScreen.hide(MainActivity.this), 2500); }

  25. nikhilsmg commented on Jun 14, 2020

    @nikhilsmg

    Worked for me:

    1.Delete (index.android.bundle) files inside directory android/app/src/main/assets.

    2.run react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

    3.Delete folders (drawable,drawable-hdpi,drawable-mdpi,drawable-xhdpi,drawable-xxhdpi,drawable-xxxhdpi,raw) inside android/app/src/main/res

    4.run react-native run-android --variant=release


    import android.os.Handler;

    @OverRide
    protected void onCreate(Bundle savedInstanceState) {
    SplashScreen.show(MainActivity.this);
    super.onCreate(savedInstanceState);
    new Handler().postDelayed(() -> SplashScreen.hide(MainActivity.this), 2500);
    }

  26. ericrguimaraes commented on Apr 19, 2023

    @ericrguimaraes

    This is not the first time that I had this issue. So this message it's for myself in future;
    To fix on iOS make sure that [RNSplashScreen show]; is the last thing before return YES;

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
      ...
      
      [RNSplashScreen show];
      
      return YES;
    }
    

    This is the fix for iOS :) thanks @rochapablo

    While it's not recommended to use this lib anymore, now that I upgraded from RN 0.70 to 0.71 using the Upgrade Helper, I inadvertedly broke it in my iOS app (I was unable to hide the splash screen) after applying the patch, because said patch now calls the corresponding method on the superclass. I managed to fix it by changing

      [RNSplashScreen show]; 
      return [super application:application didFinishLaunchingWithOptions:launchOptions];
    

    to

      BOOL ret = [super application:application didFinishLaunchingWithOptions:launchOptions];
      if (ret == YES) {
        [RNSplashScreen show]; 
      }
      return ret;
    

    This makes sure that the method show() is the last thing called, as the docs of the lib recommend.

  27. davidfarinha commented on May 16, 2023

    @davidfarinha

    BOOL ret = [super application:application didFinishLaunchingWithOptions:launchOptions];
    if (ret == YES) {
    [RNSplashScreen show];
    }
    return ret;

    Thankyou! This worked for me on react-native 0.70+ and react-native-splash-screen 3.2.0.

  28. zahid502 commented on Oct 2, 2023

    @zahid502

    [RNSplashScreen show]; return [super application:application didFinishLaunchingWithOptions:launchOptions];

    to

    BOOL ret = [super application:application didFinishLaunchingWithOptions:launchOptions]; if (ret == YES) { [RNSplashScreen show]; } return ret;

    @ericrguimaraes Thank you, it's worked for me.
    I encountered this issue with:
    "react-native": "0.72.4"
    "react-native-splash-screen": "^3.3.0"

  29. tariqj86 commented on Mar 2, 2025

    @tariqj86

    for me the issue was in link package step if you try to run yarn install or yarn add <packagename>
    you will note the the link step will fail.
    updating yarn by using yarn set version stable then run yarn install solve my issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions