我创建了一个新应用程序并尝试使用 react-native-firebase
.但我不断收到此错误:
RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects 'Podfile' and have run 'pod install'.
See http://invertase.link/ios for the ios setup guide.
我已经完成的步骤:
yarn add react-native-firebase
react-native link react-native-firebase
pod update
在确保我使用的是 Ruby 2.5.0 我目前使用的 pod 文件是:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'MyProject' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod 'Firebase/Core'
pod 'Firebase/Database'
pod 'Firebase/Messaging'
target 'MyProjectTests' do
inherit! :search_paths
# Pods for testing
end
end
这些是我正在使用的版本:
"react": "^16.3.0-alpha.1",
"react-native": "0.54.2",
"react-native-firebase": "^3.3.1",
最佳答案
如果不想手动链接,可以尝试直接将 RNFirebase 安装为 pod install:
pod 'RNFirebase', :path => 'path/to/node_modules/react-native-firebase/ios'
更改或硬编码
HEADER_SEARCH_PATHS
没有帮助我。当错误再次发生时,没有必要 rm -rf node_modules
也不删除 pod 文件等,我发现清除缓存很有用。
关于react-native - 错误 : RNFirebase core module was not found natively on iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49427871/