bamlab / react-native-make

A collection of everyday React Native CLI tools
MIT License
761 stars 87 forks source link

[question] iOS: App keeps using old splash screen #34

Closed AdrianMrn closed 4 years ago

AdrianMrn commented 4 years ago

I used this tool to create a splash screen for my app around 1.5 years ago. Now, when using it to update my splash screen, the app keeps using the old splash screen on iOS.

The LaunchScreen.xib is updated and a SplashImage image set is created in Images.xcassets, but the old LaunchImage image set remains in that same folder. The setting for Asset Catalog Launch Image Set Name is still set to LaunchImage, and changing it to SplashImage causes a build error: None of the input catalogs contained a matching launch image set named "SplashImage".

Clearing the setting causes the app to build successfully but display a completely black splash screen.

Use as launch screen is also selected in the LaunchScreen.xib's Interface Builder Document.

I have also tried removing the app from the device, restarting it and reinstalling the app.

Setting [RNSplashScreen showSplash:@"LaunchScreen" inRootView:rootView]; in my AppDelegate.m file shows the splash screen, but only after first showing the earlier mentioned black screen for a second or 2.

On Android, the correct splash screen seems to be displayed, but the app never gets past it anymore.

Does anyone know what I could be doing wrong?

iarambula commented 4 years ago

Try deleting the app from the emulator and run again.

AdrianMrn commented 4 years ago

@iarambula I tried this, it doesn't fix the issue :(

AdrianMrn commented 4 years ago

I had to clear the value for ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME and change the Launch screen file option in the General tab of the main target to the name of the .xib file:

image

image

My issue of the app not getting past the splash screen on Android was because SplashScreen.show(this, R.style.SplashScreenTheme); was being called twice in MainActivity.java (the line is added every time the splash screen command is run).

jbolotin commented 4 years ago

@AdrianMrn do you mind elaborating on clearing the value for ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME? Does that mean changing it to something, or did you delete it entirely from project.pbxproj? For me, it's creating a storyboard named SplashScreen -- Would I put SplashScreen in place of LaunchScreen in the Launch Screen File option?

I'm also wondering if this issue should be reopened because it seems to be a legit problem for the iOS issue