react-native-splash-screen: iOS SplashScreen.h file not found
Hi,
Thank you for the awesome library. With react-native 0.40, after running react-native link react-native-splash-screen and adding #import "SplashScreen.h" to AppDelegate.m for iOS, I get the error SplashScreen.h file is not found when trying to build the project.
Is anybody else experiencing the same issue or know what’s wrong?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 24
- Comments: 25 (1 by maintainers)
change from SplashScreen.h to RNSplashScreen.h and also change in the file. line 52 to [RNSplashScreen show];
Add to Header Search Paths: “$(SRCROOT)/…/node_modules/react-native-splash-screen/ios” In AppDelegate.m: #import “RNSplashScreen.h”
and
[RNSplashScreen show];
right before “return YES;”
For anyone else that got stuck on this, make sure you do step 4 of the manual installation, even if you do the automatic installation with
react-native link.To fix ‘SplashScreen.h’ file not found, you have to select your project → Build Settings → Search Paths → Header Search Paths to add:
$(SRCROOT)/…/node_modules/react-native-splash-screen/ios
Changing from SplashScreen to RNSplashScreen works, is that located anywhere in the docs currently?
I get `ld: warning: directory not found for option ‘-L/Users/…/Library/Developer/Xcode/DerivedData/msqapp-cicwbiiflhatszcxvkwjemntqxfa/Build/Products/Debug-iphonesimulator/React’ after adding the Header Search Path.
Well realise that wasn’t the error.
Its this:
This is my current
Header Search Paths:Solved: Had to do
pod installafterreact-native link react-native-splash-screenTry
pod installafterreact-native link react-native-splash-screenI ruber ducked my self in to the answer. Make sure that when you add
#import “RNSplashScreen.h”
You don’t add it below the “#if DEBUG” line
add [#import SplashScreen.h] in AppDelegate.m file. and pod install and react-native link react-native-splash-screen. this did the trick
I got stock on the first screen “Powered by React Native” when I add “[SplashScreen show];” in AppDelegate.m I guess it’s due to that.
Was having the problem, but I didn’t have to add the
Header Search Path ...., just changedAnd that fixed my problem.
Running:
this did the trick
@ManigandanRaamanathan , I had to uninstall and reinstall react-native-splash-screen to get past build failure with xcode and I went from
"version": "3.2.0"to"version": "3.0.6".