Open patrikmasiar opened 4 years ago
Any solution? Please help
Running into this too. Having only [RNSplashScreen show];
in AppDelegate.m
seems to work with getting the build to pass and run but I'm having issues with the SplashScreen hiding. The SplashScreen shows and never goes away. I verified in debug mode that the function to hide it is getting called in the correctly. Will circle back if I figure out the solution.
We hit the same "Could not load NIB in bundle" error after upgrading to react-native 0.63 and switching from LaunchScreen.xib to LaunchScreen.storyboard.
In our case it was solved by switching the "Main Interface" under Targets -> General -> Deployment Info to LaunchScreen.storyboard (you've probably already done this for "Launch Screen File").
Same here
@tronginc @rickgrundy @metion @massoprod
The issue is, Xcode project is now updated in 0.63 with UIView nib to UIViewController in LaunchScreen.storyboard which means the function in native has to update and change view loading from nib to view controller... Easy solution replace function showSplash with below given fixed code in file RNSplashScreen.m and set storyboard id see attachment below Now it won't crash :)
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView {
if (!loadingView) {
UIStoryboard *sb = [UIStoryboard storyboardWithName:splashScreen bundle:nil];
UIViewController *vc = [sb instantiateViewControllerWithIdentifier:splashScreen];
loadingView = vc.view;//[[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0];
CGRect frame = rootView.frame;
frame.origin = CGPointMake(0, 0);
loadingView.frame = frame;
}
waiting = false;
[rootView addSubview:loadingView];
}
@AlishahSolanki This is the solution when using a storyboard.
Didn't see a PR so ... https://github.com/crazycodeboy/react-native-splash-screen/pull/502
UPDATE - i'm getting black screen flash immediately prior to the splash screen showing up. Only happens on device, not simulator. Only on iOS. Android working ok.
@tronginc @rickgrundy @metion @massoprod
The issue is, Xcode project is now updated in 0.63 with UIView nib to UIViewController in LaunchScreen.storyboard which means the function in native has to update and change view loading from nib to view controller... Easy solution replace function showSplash with below given fixed code in file RNSplashScreen.m and set storyboard id see attachment below Now it won't crash :)
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView { if (!loadingView) { UIStoryboard *sb = [UIStoryboard storyboardWithName:splashScreen bundle:nil]; UIViewController *vc = [sb instantiateViewControllerWithIdentifier:splashScreen]; loadingView = vc.view;//[[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0]; CGRect frame = rootView.frame; frame.origin = CGPointMake(0, 0); loadingView.frame = frame; } waiting = false; [rootView addSubview:loadingView]; }
How do I set storyboard id
? No idea where this screenshot is from
@tronginc @rickgrundy @metion @massoprod The issue is, Xcode project is now updated in 0.63 with UIView nib to UIViewController in LaunchScreen.storyboard which means the function in native has to update and change view loading from nib to view controller... Easy solution replace function showSplash with below given fixed code in file RNSplashScreen.m and set storyboard id see attachment below Now it won't crash :)
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView { if (!loadingView) { UIStoryboard *sb = [UIStoryboard storyboardWithName:splashScreen bundle:nil]; UIViewController *vc = [sb instantiateViewControllerWithIdentifier:splashScreen]; loadingView = vc.view;//[[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0]; CGRect frame = rootView.frame; frame.origin = CGPointMake(0, 0); loadingView.frame = frame; } waiting = false; [rootView addSubview:loadingView]; }
How do I
set storyboard id
? No idea where this screenshot is from
You can view it in your Inspectors pane. Then it will be under Show the Identity Inspector tab
I was in the same situation as @rickgrundy with switching from LaunchScreen.xib
to LaunchScreen.storyboard
. Was seeing the same "Could not load NIB" error and the app crashing when SplashScreen.hide() was called.
@rickgrundy's fix worked. Thanks!
@tronginc @rickgrundy @metion @massoprod The issue is, Xcode project is now updated in 0.63 with UIView nib to UIViewController in LaunchScreen.storyboard which means the function in native has to update and change view loading from nib to view controller... Easy solution replace function showSplash with below given fixed code in file RNSplashScreen.m and set storyboard id see attachment below Now it won't crash :)
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView { if (!loadingView) { UIStoryboard *sb = [UIStoryboard storyboardWithName:splashScreen bundle:nil]; UIViewController *vc = [sb instantiateViewControllerWithIdentifier:splashScreen]; loadingView = vc.view;//[[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0]; CGRect frame = rootView.frame; frame.origin = CGPointMake(0, 0); loadingView.frame = frame; } waiting = false; [rootView addSubview:loadingView]; }
How do I
set storyboard id
? No idea where this screenshot is from
For anyone else as confused as I was by these vague instructions, open your LaunchScreen.storyboard and then follow the steps below.
@tronginc @rickgrundy @metion @massoprod
The issue is, Xcode project is now updated in 0.63 with UIView nib to UIViewController in LaunchScreen.storyboard which means the function in native has to update and change view loading from nib to view controller... Easy solution replace function showSplash with below given fixed code in file RNSplashScreen.m and set storyboard id see attachment below Now it won't crash :)
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView { if (!loadingView) { UIStoryboard *sb = [UIStoryboard storyboardWithName:splashScreen bundle:nil]; UIViewController *vc = [sb instantiateViewControllerWithIdentifier:splashScreen]; loadingView = vc.view;//[[[NSBundle mainBundle] loadNibNamed:splashScreen owner:self options:nil] objectAtIndex:0]; CGRect frame = rootView.frame; frame.origin = CGPointMake(0, 0); loadingView.frame = frame; } waiting = false; [rootView addSubview:loadingView]; }
This worked on React 66. Thanks @AlishahSolanki !
Any chance we can get this fix for this merged?
react: 16.9.0 react-native: 0.61.5
react-native-splash-screen: 3.2.0
iOs issue
Once the application starts and the splash screen is shown, the application freezes and it is not working then. The splash screen is not hidden and I can go into my application.
Error from Xcode:
"Could not load NIB in bundle: 'NSBundle..."
Show splash screen in AppDelegate.m