Open erdemildiz opened 6 years ago
My issue was that various pods were using different versions of React. I needed a unified reference. Auto-removing them in the podfile fixed this issue and others.
target <yourTarget> do
pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
pod 'React', :path => '../node_modules/react-native', :subspecs => [
'BatchedBridge', # Required For React Native 0.45.0+
'Core',
# Add any other subspecs you want to use in your project
]
end
# Remove React from projects
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == "React"
target.remove_from_project
end
end
end
ios需要用pod 不能用link(貌似新版RN都这样了) 安装完插件后,ios直接执行下面的操作,不要操作官方的步骤 cd ios/, 运行pod install下载库 然后building setting -> header search paths -> 添加 "${PODS_ROOT}/Headers/Public/react-native-splash-screen" 记得引号是英文的
AppDelegate.m添加代码 (记得官方推荐的SplashScreen.h改成RNSplashScreen.h !!)
...
[self.window makeKeyAndVisible];
[RNSplashScreen show]; // 启动后进入启动页
return YES;
...
有用的记得点赞
ios需要用pod 不能用link(貌似新版RN都这样了) 安装完插件后,ios直接执行下面的操作,不要操作官方的步骤 cd ios/, 运行pod install下载库 然后building setting -> header search paths -> 添加 "${PODS_ROOT}/Headers/Public/react-native-splash-screen" 记得引号是英文的
AppDelegate.m添加代码 (记得官方推荐的SplashScreen.h改成RNSplashScreen.h !!)
import "RNSplashScreen.h" //引入头文件
... [self.window makeKeyAndVisible]; [RNSplashScreen show]; // 启动后进入启动页 return YES; ...
有用的记得点赞
老哥强,我用教程的 header search paths路径一直是找不到RNSplashScreen.h,用这个路径就可以了
Translated version of @lee-my 's answer... Thanks for answer @lee-my Bro... (This is the correct answer)
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 !!)
... [self.window makeKeyAndVisible]; [RNSplashScreen show]; // Enter the startup page after startup Return YES;
@lee-my 正解✅
I am getting this error. Somebody help me please;
`RCTSplashScreen.h:9:9: fatal error: 'React/RCTBridgeModule.h' file not found
import <React/RCTBridgeModule.h>`
It s my package.json