crazycodeboy / react-native-splash-screen

A splash screen for react-native, hide when application loaded ,it works on iOS and Android.
MIT License
5.59k stars 1.09k forks source link

Xcode 12 splash screen compatibility, compile errors #520

Open daaashleywch opened 3 years ago

daaashleywch commented 3 years ago

Environment: OS: macOS Big Sur 11.2.2 Node: 11.10.1 Yarn: 1.19.1 npm: 6.7 Watchman: 4.7.0 Xcode: Xcode 12.4 stable Android Studio: NA

Packages: (wanted => installed) react-native: 0.62.2 => 0.63.4 (current stable) react: 16.13.1

Target Platforms: iOS 9-11

Steps to Reproduce Xcode 12 reveals a dependency issue for React Native in the Podspec file of every native library.

See this comment here on the React Native Repo: facebook/react-native#29633 (comment) . Notice following that comment all of the repos that that feed gets mentioned in, and how they all updated this dependency thereafter.

This change, s.dependency from 'React' to 'React-Core' is needed to get this module to compile correctly with react native in Xcode 12. Without this change, Xcode 12 fails to compile the library, at least with newer version of react native.

I currently have this patch and it works with Xcode 12: image

isipisi89 commented 3 years ago

You have to ignore the official steps.

Ios needs to use pods and can not use link (it looks like the new version of RN is like this) After installing the plugin, ios directly performs the following operations, do not operate the official steps. Cd ios/, Run pod install to download the library Then building setting -> header search paths -> add "${PODS_ROOT}/Headers/Public/react-native-splash-screen" Remember that the quotes are in English

Add code to AppDelegate.m (Remember the officially recommended SplashScreen.h changed to RNSplashScreen.h !!)

import //Introduction header file

... [self.window makeKeyAndVisible]; [RNSplashScreen show]; // Enter the startup page after startup Return YES;

daaashleywch commented 3 years ago

@isipisi281 I have been using pods with react native since 0.59. When upgrading to .63.4 I had to apply the above patch to all libraries that have not yet updated the dependency. It looks like most libraries with support for newer react native are making this change. This got splash screen to work for me. I'm not sure what changing header paths does. I just felt I should leave a note so this library would be aware of the change thats all. I don't have knowledge of inner workings of splash screen, just thought i'd open this as a comment just in case. (: