React-native-splash-screen: iOS SplashScreen.h file not found

Created on 13 Jan 2017  Â·  24Comments  Â·  Source: crazycodeboy/react-native-splash-screen

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?

Most helpful comment

change from SplashScreen.h to RNSplashScreen.h and also change in the file.
line 52 to [RNSplashScreen show];

All 24 comments

I am facing the same issue.
@junshengpierre Is there any fix?

I also have the same problem.

Same problem for me, Android's working but for iOs the build is broken

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.

Haven't tried it yet but I think this is fixed in V2.0.0.

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

@junshengpierre doesn't works for me. I did all steps ;)

Fixed

@beaurushton solution fixed it. Thanks

@OpakAlex I am also getting the error and I followed all steps.
Can you please help me, how did you solve?

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

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

Changing from SplashScreen to RNSplashScreen works, is that located anywhere in the docs currently?

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

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"

I tried the above fix and got this error:

 warning: extra tokens at end of #import directive [-Wextra-tokens]
#import "SplashScreen.h" => #import "RNSplashScreen.h"
                         ^
                         //
/Users/danale/Projects/engage-application.mobile/ios/NFIBEngage/AppDelegate.m:17:9: fatal error: 'SplashScreen.h' file not found
#import "SplashScreen.h" => #import "RNSplashScreen.h"
        ^~~~~~~~~~~~~~~~
1 warning and 1 error generated.

I am running:

"react": "16.2.0",
"react-native": "0.53.3",
"react-native-splash-screen": "^3.0.6",

@ldco2016 did you find any other solution?

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

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

this did the trick

add [#import SplashScreen.h] in AppDelegate.m file. and pod install and react-native link react-native-splash-screen. this did the trick

tried all of the above approach, still looking for solution.

I'm having the same problem. It doesn't appear to be code related as I can build in the DEBUG scheme but I'll get the error if I switch it to Release

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

Was this page helpful?
0 / 5 - 0 ratings