Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

react native splash screen get 'React/RCTBridgeModule.h' file not found

$
0
0

I started a new react native application using :

react-native init myApplication

I started with splash screen so i used this library react native spalsh screen

I linked the library to generate native code using this command :

react-native link react-native-splash-screen

And i added files using Xcode like this :

  1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
  2. Go to node_modules ➜ react-native-splash-screen and add SplashScreen.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libSplashScreen.a to your project's Build Phases ➜ Link Binary With Libraries
  4. To fix 'RNSplashScreen.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

I build the app using Xcode in a real Iphone and i get this error in RNSplashScreen.h :

    /**
 * SplashScreen
 * 启动屏
 * from:http://www.devio.org
 * Author:CrazyCodeBoy
 * GitHub:https://github.com/crazycodeboy
 * Email:crazycodeboy@gmail.com
 */
#import <React/RCTBridgeModule.h> // <------'React/RCTBridgeModule.h' file not found
#import <UIKit/UIKit.h>

@interface RNSplashScreen : NSObject<RCTBridgeModule>
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView;
+ (void)show;
+ (void)hide;
@end

'React/RCTBridgeModule.h' file not found

the Podfile :

    pod 'React', :path => '../node_modules/react-native/'
    pod 'React-Core', :path => '../node_modules/react-native/React'
    ...... # other libaries
    pod 'react-native-splash-screen', :path => '../node_modules/react- 
    native-splash-screen'

AppDelegate.m :

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNSplashScreen.h"

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  ....  <------- other code
  [RNSplashScreen show];
  return YES;
}

Viewing all articles
Browse latest Browse all 16750

Trending Articles