react-native-bootsplash: White screen and deadlock warning.

💻 My environment

  • react-native-bootsplash version: ^2.2.3
  • react-native version:~0.61.4
  • Platform: iOS
  • OS version: IOS 13.4
  • Device: iPhone 11(13.4.1)
  • Simulator: yes
  • Android Studio version: ?
  • Android buildToolsVersion: ?
  • Xcode version: 11.4.1

🕵️‍♂️ Reproducing the issue

I am not sure what i did wrong, but every time splash screen appears with white screen at the end. And. having warnings: Simulator Screen Shot - iPhone 11 - 2020-04-24 at 19 01 36

My code in xcode:

/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#import "AppDelegate.h"

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#import <UMCore/UMModuleRegistry.h>
#import <UMReactNativeAdapter/UMNativeModulesProxy.h>
#import <UMReactNativeAdapter/UMModuleRegistryAdapter.h>

#import "Orientation.h"

#import "RNBootSplash.h"

@implementation AppDelegate

@synthesize window = _window;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]];
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"lolApp" initialProperties:nil];
  rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  UIViewController *rootViewController = [UIViewController new];
  rootViewController.view = rootView;
  
  [RNBootSplash initWithStoryboard:@"BootSplash" rootView:rootView];
  
  self.window.rootViewController = rootViewController;
  [self.window makeKeyAndVisible];

  [super application:application didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

- (NSArray<id<RCTBridgeModule>> *)extraModulesForBridge:(RCTBridge *)bridge
{
  NSArray<id<RCTBridgeModule>> *extraModules = [_moduleRegistryAdapter extraModulesForBridge:bridge];
  // You can inject any extra modules that you would like here, more information at:
  // https://facebook.github.io/react-native/docs/native-modules-ios.html#dependency-injection
  return extraModules;
}

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
  return [Orientation getOrientation];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
#ifdef DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

@end

Screenshot at Apr 24 19-47-16

react native:

import 'react-native-gesture-handler'; // should be first import in App file
import React from 'react';
import MainNavigator from './src/screens/main/MainNavigator';
import { StatusBar } from 'react-native';
import { Provider } from 'react-redux';
import configureStore from './src/redux/store/store';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import RNBootSplash from "react-native-bootsplash";

const store = configureStore();

export default function App() {

//RNBootSplash.hide({ duration: 1000 });
RNBootSplash.hide();

  return (
    <Provider store={store}>
      <StatusBar backgroundColor='#133740' barStyle='light-content' />
      <SafeAreaProvider>
        <NavigationContainer>
          <MainNavigator />
        </NavigationContainer>
      </SafeAreaProvider>
    </Provider>
  );
}

gif with demo of white screen with duration: 2020-04-24 18 43 22 without duration: 2020-04-24 18 42 29

🤞Solution

I am noob in programming with react-native and javascript. Can anyone explain me what am i doing wrong?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

@zoontek Uh well, But why it takes a long time to hide splash in android! unlike ios its work as expected!

Overall I’m having all way too slow in android in thinking its the difference in systems and optimization issues.