Open aleksandr-senichev opened 7 years ago
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.
Out of curiosity, are you using the wix navigator (react-native-navigation)?
@emin93 I just switched to react-native-navigation and it started to bug... Do you have a solution ?
Same thing happened to me on Android.
componentWillMount () {
SplashScreen.show();
}
componentDidMount () {
SplashScreen.hide();
}
Any solution for this?
same for me on android, and I am using wix navigation
I managed to solve this issue by removing
SplashScreen.show()
I did the same but then the splashscreen never shows...
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.
+1 Using "react-native":"0.47.2" and "react-native-splash-screen":"^3.0.6"! The screen does not disappear after calling SplashScreen.hide() in componentDidMount() function in my LoginScreen. Here is my AppDelegate.m
#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "SplashScreen.h"
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyApp"
initialProperties:nil
launchOptions:launchOptions];
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;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[SplashScreen show];
return YES;
}
@end
Here is my LoginScreen.js (as part of StackNavigator of react-navigation):
const AuthNavigator = StackNavigator(
{
LoginScreen: {screen: Login},
RegisterScreen: {screen: Register}
},
{
initialRouteName: 'LoginScreen',
headerMode: 'none'
}
)
...
class LoginScreen extends React.Component {
componentDidMount() {
setTimeout(SplashScreen.hide(), 3000)
}
...
}
Any help?
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.
Any solution?
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.
Did you have a look in #87?
android, v3.0.6 with react-native v0.54.4.
Sometimes splash screen stays forever, although I explicitly call SplashScreen.hide()
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"
@wincod75 I'm using the same RN version but in my case, that fix doesn't seem to work all the time. it was working correctly on iOS, then tried to run it on android, and now it doesn't work on Android and iOS
Any other fix around?
Environment:
OS: macOS High Sierra 10.13.3
Node: 7.9.0
Yarn: 0.23.2
npm: 5.8.0
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.4 => 0.55.4
UPDATE : My bad, I was initializing the app on a different screen, and I never called SplashScreen.hide();
@cihadturhan did you manage to solve it? It happens on my case also from time to time, on Android
Same. But only when I build release. Any solution?
I'm using react-navigation and have SwitchNavigator
for navigate user base on his/her authentication to the proper page. but unfortunately after first time the app is initialize on release mode
the splash screen stuck and never disappear. @wincod75 I think your solution might be closer to my problem but I have to say I've user TabNavigator
from react-navigation
and when user has auth to access to the tabs
then the splash screen does not disappear.
Here is what RNN suggested https://medium.com/@pqkluan/how-to-implement-splash-screen-in-react-native-navigation-ee2184a1a96
Having the same problem with react-native-navigation (wix). Stuck on splash-screen, and after some time app crashes.
@onlaps maybe this tutorial could help you How to implement Splash Screen in React Native Navigation
I have the same issue in the release build react-native: 0.56.0 react-native-splash-screen: 3.1.1 and I use the react-navigation library for navigating
Having the same problem with react-navigation. This only happens in the release build.
I had this issue too, on iOS only. After debugging, I switched to [RNSplashScreen showSplash: inRootView:]
instead of show:
and it finally worked.
So my didFinishLaunching
code in AppDelegate looks like this instead:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[BugsnagReactNative start];
NSURL *jsCodeLocation;
#ifdef DEBUG
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
moduleName:@"MyApp"
initialProperties:nil
launchOptions:launchOptions];
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;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
[RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootViewController.view];
return YES;
}
This assumes you’re using the LaunchScreen.xib file, not launch images.
Thanks @its-artemis-actually!!!
I had same issue, none of the above solutions worked for me, Then what i simply did was "Cleared Cache" of the temporary app on the emulator and it worked!... now i am afraid it will of-course happen again when that cache comes back!..
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);
}
}
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;
}
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 ?
Same issue here - in debug build it works just fine, but on release stays stuck
1+
The issue for me is unpredictable. None of the behavior seems to make sense but here is what I'm seeing ->
I haven't tried a release build yet.
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 beforereturn YES;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [RNSplashScreen show]; return YES; }
This is the correct fix for iOS
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 beforereturn YES;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ... [RNSplashScreen show]; return YES; }
This is the fix for iOS :) thanks @rochapablo
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); }
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); }
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 beforereturn 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.
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 beforereturn 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.
Thank you very much. I encountered this issue with React Native 0.71.6 and react-native-splash-screen 3.3.0 and have successfully fixed it.
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.
[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"
"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.