ios 通过 Pod 添加 Firebase 后,Xcode 无法识别 GoogleService-Info.plist 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37578378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 09:13:25  来源:igfitidea点击:

Xcode doesn't recognize GoogleService-Info.plist file after adding Firebase via pods

iosswiftfirebase

提问by Bruno Lemos

I'm trying to add Firebase and I keep getting a log message thats says:

我正在尝试添加 Firebase,但不断收到一条日志消息,内容为:

Could not locate configuration file: 'GoogleService-Info.plist'.

找不到配置文件:“GoogleService-Info.plist”。

I added the file in Xcode by way of File > Add new file to project.
Any suggestions?

我通过File > Add new file to project.
有什么建议?

enter image description here

在此处输入图片说明

采纳答案by Eduardo Aguirree Edair

It happen to me. Just erase the (7). The Xcode firebase framework connects to firebase through the GoogleService-Info.plist when you build your code an error will be display if the .plist file is not called exactly: GoogleService-Info.plist . At the moment that the .plist file have another character in the name the firebase framework will not recognise it. The frame work is searching just for the 'GoogleService-Info.plist' not 'GoogleService-Info.plist (07)'

它发生在我身上。只需擦除(7)。当您构建代码时,Xcode firebase 框架通过 GoogleService-Info.plist 连接到 firebase,如果 .plist 文件没有被准确调用,则会显示错误: GoogleService-Info.plist 。当 .plist 文件的名称中有另一个字符时,firebase 框架将无法识别它。该框架仅搜索“GoogleService-Info.plist”而不是“GoogleService-Info.plist (07)”

This usually happens when you download several times your GoogleService-Info.plist from the console. If you want to avoid this. Get the file out from your "downloads" carpet. Otherwise, your computer is going to add a number at the end of the name file if you already have one inside that carpet. It creates a copy.

当您从控制台多次下载 GoogleService-Info.plist 时,通常会发生这种情况。如果你想避免这种情况。从“下载”地毯中取出文件。否则,如果您在地毯中已经有了一个数字,您的计算机将在名称文件的末尾添加一个数字。它创建一个副本。

Hope this can help!

希望这可以帮助!

回答by Bruno Lemos

To anyone still having this issue:

对于仍然有此问题的任何人:

  1. Add the file to the project
  2. Click on it:
  1. 将文件添加到项目中
  2. 点击它:

enter image description here

在此处输入图片说明

  1. On the right sidebar from Xcode, mark the Target Membershipoption:
  1. 在 Xcode 的右侧边栏上,标记该Target Membership选项:

enter image description here

在此处输入图片说明

回答by Surendra Kumar

I solved this by using these steps :

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

  1. Go to Build Phases of your project enter image description here

  2. Expand "Copy Bundle Resources"

  3. Click on Plus (+) button and add "GoogleService-Info.plist" file.
  1. 转到项目的构建阶段 在此处输入图片说明

  2. 展开“复制捆绑资源”

  3. 单击加号 (+) 按钮并添加“GoogleService-Info.plist”文件。

clean and build your project.

清理并构建您的项目。

回答by Yakup Ad

https://github.com/firebase/quickstart-ios/issues/5

https://github.com/firebase/quickstart-ios/issues/5

I had the same problem. I solved the problem by following the steps below Source: https://github.com/firebase/quickstart-ios/issues/5

我有同样的问题。我按照以下步骤解决了问题来源:https: //github.com/firebase/quickstart-ios/issues/5

回答by kye

Change the plistname from GoogleService-Info(7).plistto GoogleService-Info.plist

plist名称从更改GoogleService-Info(7).plistGoogleService-Info.plist

回答by Harshita Ahuja

This file should be in your project directory, not in pods directory.

这个文件应该在你的项目目录中,而不是在 pods 目录中。

回答by Basir Alam

Rename your file GoogleService-Info(7).plistto GoogleService-Info.plist.

将您的文件重命名GoogleService-Info(7).plistGoogleService-Info.plist.