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)

Most upvoted comments

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:

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RNSplashScreen", referenced from:
      objc-class-ref in AppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This is my current Header Search Paths: image

Solved: Had to do pod install after react-native link react-native-splash-screen

Try pod install after react-native link react-native-splash-screen

I 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 changed

#import "SplashScreen.h" => #import "RNSplashScreen.h"

[SplashScreen show]; =>   [RNSplashScreen show];

And that fixed my problem.

Running:

    "react": "16.3.1",
    "react-native": "^0.55.4",
"react-native-splash-screen": "^3.0.9"

Try pod install after react-native link react-native-splash-screen

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".