以下是错误的完整上下文:
Error: RNFirebase core module was not found natively on iOS, ensure you have correctly included the RNFirebase pod in your projects
Podfileand have run
pod install`。
有关 ios 设置指南,请参阅 http://invertase.link/ios。`
我的 PodFile:
# Created by react-native-pod
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '13.0'
target 'myapp' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
pod 'Firebase/Messaging', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'RNFBApp', :path => '../node_modules/@react-native-firebase/app'
target 'myappTests' do
inherit! :complete
# Pods for testing
end
end
我的 package.json 包含这个:
"dependencies": {
"@callstack/reanimated-arc": "^0.1.0-alpha.3",
"@react-native-community/async-storage": "^1.6.1",
"@react-native-community/datetimepicker": "^3.0.2",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/picker": "^1.8.1",
"@react-native-community/push-notification-ios": "^1.0.3",
"@react-native-cookies/cookies": "^6.2.1",
"@react-native-firebase/app": "^17.4.3",
"@react-native-firebase/messaging": "^17.4.3",
我一直看到 RNFirebase 在
react-native-firebase
包中找到,但我已经有了 @react-native-firebase
我的 XCode 中的 Libraries 文件夹也是空的,我已经这样做了
npx react-native link @react-native-firebase/app
如何消除错误并正确构建应用程序
此外,在我的情况下,react-native 链接似乎无法正常工作,因此请确保在“构建阶段/链接二进制与库”中添加 libRNFirebase.a(如果不存在),但也可能不存在。我会把它留在这里,以防有人来时仍然遇到问题。确保您已添加 $(inherited) 用于调试和发布并具有递归值。