React-native firebase Error: The bundle identifier of the application could not be determined

React-native firebase Error: The bundle identifier of the application could not be determined

我正在尝试安装 https://rnfirebase.io/。当我初始化一个新的 react-native 文件时,它 运行 在 ios.

中很好

根据这些文档,当我安装 RN Firebase 时问题开始了:

https://rnfirebase.io/docs/v4.2.x/installation/ios

我收到以下错误(当我尝试在 xcode 中 运行 时,我在下面的屏幕截图中收到错误):

正在安装 build/Build/Products/Debug-iphonesimulator/test2.app 处理命令时遇到错误(域=NSPOSIXErrorDomain,代码=22): 无法安装请求的应用程序 无法确定应用程序的包标识符。 确保应用程序的 Info.plist 包含 CFBundleIdentifier 的值。 打印:条目,“:CFBundleIdentifier”,不存在

命令失败:/usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/test2.app/Info.plist 打印:条目,“:CFBundleIdentifier”,不存在

我已经尝试了针对类似问题的所有建议,但我似乎无法弄清楚。任何帮助将不胜感激。

谢谢。

首先,在 运行 pod install 之后,使用 yourapp.xcworkspace,而不是 yourapp.xcodeproject 打开你的项目。

打开项目后,添加 Bundle 标识符。根据官方教程使用该包标识符创建一个 firebase 应用程序。

1.In docs 建议将您的 Googleservice-info.plist 文件放在 ios/[您的应用名称]/GoogleService-Info.plist 下。但是当我把它放在 ios/GoogleService-Info.plist.

下时它对我有用

2.Make 确保 GoogleService-Info.plist 文件中的 BUNDLE ID 密钥具有您项目的包 ID。