【问题标题】:cordova-firebase-plugin configuration for iOS适用于 iOS 的 cordova-firebase-plugin 配置
【发布时间】:2016-12-13 16:57:16
【问题描述】:

我正在使用 Cordova 开发一个应用程序。在 Android 上,Firebase 插件运行良好,但我在 iOS 上遇到了这个问题:

<Error> [Firebase/Core][I-COR000009] The GOOGLE_APP_ID either in the plist
file 'GoogleService-Info.plist' or the one set in the customized options
is invalid. If you are using the plist file, use the iOS version of bundle
identifier to download the file, and do not manually edit the
GOOGLE_APP_ID. You may change your app's bundle identifier to '(null)'. Or
you can download a new configuration file that matches your bundle
identifier from https://console.firebase.google.com/ and replace the
current one.

*** Terminating app due to uncaught exception 'com.firebase.core', reason:
'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in
GoogleService-Info.plist or set in the customized options.'

我将 GoogleService-Info.plist 放在项目的根文件夹中,与 .xcodeproj 文件位于同一文件夹中。

【问题讨论】:

    标签: ios cordova firebase


    【解决方案1】:

    对你来说可能为时已晚,但如果其他人像我一样来到这里,这个文件应该放在你的 cordova 项目的根目录中。该插件具有挂钩,可在构建期间将文件复制到您的 xcode 项目中。

    【讨论】:

      【解决方案2】:

      我通过以下步骤解决了这个问题:

      1. 在项目根文件夹中添加 GoogleService-Info.plist 文件。
      2. 为 ios 平台创建构建。
      3. 在设备上运行项目 throw Xcode。检查是否发生错误。 在以下位置下载新的 GoogleService-Info.plist 文件替换 地点。
      4. platforms/ios/ProjectName/Resources/Resources/

      【讨论】:

      • bty 我在平台/ios//Resources/Resources 中有 GoogleService-Info.plist 仍然出现错误
      • 从 firebase 控制台下载新的 GoogleService-Info.plist 文件。并检查platforms/ios/Resources/ProjectName/Resources/Resources 文件夹有.plist 文件也替换它们。
      猜你喜欢
      • 2023-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-16
      • 1970-01-01
      相关资源
      最近更新 更多