Could not find a valid GoogleService-Info.plist in

2020-02-08 06:51发布

When I run my swift 3.2 code with Xcode 9 beta 4 this is the error I get:

*** Terminating app due to uncaught exception 'com.firebase.core', reason: '[FIRApp configure]; (FirebaseApp.configure() in Swift) could not find a valid GoogleService-Info.plist in your project. Please download one from https://console.firebase.google.com/.'

I already have a GoogleService-Info.plist file that is named exactly like it should and it is valid.

Is there any trial to firebase or something like that?

17条回答
我欲成王,谁敢阻挡
2楼-- · 2020-02-08 07:04
  1. Actually this error is occur when GoogleService-Info.plist file is not actually located in our project folder but it just have a reference to that file where it is downloaded. So solution is that remove reference to this file and again add it to your project folder by drag and drop or by using "Add Files ..." option by right click to your project folder. Also recheck whether file is locating your project folder destination otherwise error will be occur again.

  2. Don't forget to check your "GoogleService-Info.plist" file have same name as shown in error otherwise rename it.

查看更多
别忘想泡老子
3楼-- · 2020-02-08 07:07

Once you add the file to the project, you may also need to add it to Build Phases in the Compile Sources section.

查看更多
在下西门庆
4楼-- · 2020-02-08 07:08

Go to build phases and add file in copy bundle resources. Thats it.

查看更多
够拽才男人
5楼-- · 2020-02-08 07:09

Doing a clean then build a couple times worked for me.

查看更多
放我归山
6楼-- · 2020-02-08 07:12

Below setting can fix my compiler fail 1. Add to "Copy Files" 2. Not add to "Copy Bundle Resources"

enter image description here

查看更多
仙女界的扛把子
7楼-- · 2020-02-08 07:12

I had the same issue.

Click on the Googleservice-info.plist in your project and check Target Membership for app in the inspector. That fixed it for me.

That is the reason for this crash and removing the file and adding again is another way of doing as suggested by answers above. But the actual cause is this and this is the right way to solve it.

Please refer to the image below for further clarification:

enter image description here

查看更多
登录 后发表回答