Could not find a valid GoogleService-Info.plist in your project

Viewed 125079

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?

29 Answers

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

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

If you have multiple environments (Production, Develop, Staging), you will need a different Google.plist for each.

They all have to have the same name.

To get around this, create folders for each of these files (one for each environment) and place them inside their corresponding folders.

When you drag the files from the Finder to Xcode, make sure to select the proper environment for each under Target Membership

That will do the trick and allow you to build environments separately. Especially if each environment has a different Bundle ID.

enter image description here

Add the GoogleService-Info.plist in Build Phases as screenshot above:

Make sure your file name is correct as "GoogleService-Info.plist". Any other name would cause problem. Restart XCode and you are good to go.

Restarting Xcode worked for me, none of the above option worked.

These steps solved my problem. FOllow these. 1.You must drag and drop the GoogleService-Info.plist file into your project in a location such as Shared Resources. When you have successfully added the file, you should also make sure to include it in the project build:

2.Double-check that in the "Build Phases" section of your project that your project is including GoogleService-Info.plist.

3.Double check the file name. The file name must be exactly GoogleService-Info.plist common misspellings include GoogleServices-Info.plist and GoogleService-info.plist - case sensitive and exactly named only will work.

For those of you working with Ionic, make sure to open your .xcworkspace file in Xcode first, then drag the GoogleService-info.plist file into the Resources folder.

Most tutorials online don't do a good job of explaining that portion for some reason.

Shout out to Shahzaib Maqbool because his comment helped me get this for my project.

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

enter image description here

We must make sure that full path is correct in Xcode. It would be better to add it from the start. If you already did, jump to step 5.

  1. Quit Xcode.
  2. Make sure that file name is correct, "GoogleService-Info.plist".
  3. Add .plist file to project folder. Same level with Podfile, .xcworkspace, etc.
  4. Open Xcode, identify .plist file on Project Navigator. If it's not there, right-click and click Add new file to "[Project Name]". Make sure to click project name below Add to targets option.
  5. On Project Navigator, click on GoogleService-Info.plist. Select File Inspector from right navigator. Ensure that Full Path is correct. If not, click on folder icon and select the .plist file inside the project file.
  6. Build. If still doesn't work, Quit Xcode and Build again.

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

1 - open "GoogleService-Info.plist" and change any or to and

2 - reopen the xamarin solution 3 - it should work now

I solved the issue by deleting the project from Firebase and deleted the GoogleService-Info.plist from project. After I again added the project to Firebase and added the new GoogleService-Info.plist file worked for me.

This error occur download google service more than 1 time. When we download first time from firebase, it's like GoolgeService-Info.Plist. If you download again, that will come GoogleService-Info(1).Plist. We need to remove (1) from GoogleService-Info(1).Plist.

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

delete any other "GoogleService-Info.plist" files that have been previously installed. in my case, when I installed it, it was names as "GoogleService-Info.plist-2" since I had another file installed in the same folder. it looks that this will create a confusion for firebase. I deleted all old files and changed the name of the current one to "GoogleService-Info.plist" exactly. it worked.

In my case something went wrong when i merged conflicts in project.pbxproj

GoogleService-Info.plist -> didn't have Target membership selected on the right pane and I couldn't select it because project.pbxproj was corrupted (even though build was successful)

I had to rollback project.pbxproj and after that GoogleService-Info.plist had Target membership selected.

Make sure project.pbxproj isn't corrupted after merging conflicts (it had something to do with attempted to initialize an object with an unknown UUID)

For anyone using Xamarin by mistake (you should avoid this piece of tool by all means): open project file as code, and check that the file has import tag BundleResource, and not None (the red one is the correct one): enter image description here

I'm using FirebaseUI and was receiving a slightly different error when pressing Sign-In with Google:

***Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'OAuth client ID not found. Please make sure Google Sign-In is enabled in the Firebase console. You may have to download a new GoogleService-Info.plist file after enabling Google Sign-In.'

What fixed that issue for me was changing this line (that seems to be deprecated)

[[FUIGoogleAuth alloc] init]]

to

[[FUIGoogleAuth alloc] initWithAuthUI:[FUIAuth defaultAuthUI]]

when building providers list

NSArray<id<FUIAuthProvider>> *providers = @[
  [[FUIGoogleAuth alloc] initWithAuthUI:[FUIAuth defaultAuthUI]],
  [[FUIPhoneAuth alloc] initWithAuthUI:[FUIAuth defaultAuthUI]]
];

Another easily overlooked problem is when you have multiple PLIST files downloaded so the file is not exactly named 'GoogleService-Info.plist'.

I had multiple copies so was trying to use 'GoogleService-Info.plist(2)' which throws the same error, so make sure the file itself is named as it is meant to be!

Please try this. Click on GoogleService-Info. checked the target membership on the right side . Clean and build . It will work.

My problem same this case and solved that -> ı added xcode runner Open Xcode, then right-click on Runner directory and select Add Files to "Runner". most importantly; terminal: cd ios- " pod install " and info.list thats ok. ı hope your problems solved

I had to same issue and same error what you have. I downloaded from Firebase more than one info.plist file that why my MacBook save these files like GoogleService-Info.plist,GoogleService-Info-2.plist,GoogleService-Info-3.plist

Then I copied mistakenly in my project GoogleService-Info-3.plist then I took same error. Then I just copied GoogleService-Info.plist and problem has been solved.

But be careful about bundle identifier. You have to copied correct project plist.

2022 Update

If you're migrating from older firebase version and want to initialize Firebase from Dart only, then you have to remove Firebase Initialization from AppDelegate.m or Appdelegate.swift

in swift, remove FirebaseApp.configure()

and start again.

If your mac add some number by default to your google file u must to delete it and write the file like that "GoogleService-Info.plist" and drag it to your xcode project I hope that will be usefull :)

Related