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

IosSwiftFirebaseFirebase Authentication

Ios Problem Overview


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?

Ios Solutions


Solution 1 - Ios

Remove the Google-Info.plist file from your project and try to add it from your project folder's option menu.

https://i.stack.imgur.com/3MlVP.jpg" width="400" />

EDIT: this is how you remove a plist file https://stackoverflow.com/questions/50718018/xcode-10-error-multiple-commands-produce

Solution 2 - Ios

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

Solution 3 - Ios

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

Solution 4 - Ios

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.

Solution 5 - Ios

  1. Make sure the name of the file is correct, i.e: "GoogleService-info.plist"
  2. Add it to the project in mac finder under the project name and then drag it into the project to reference it.
  3. Finally, as Silvajee mentioned, go to the file inspector for the plist file and tick the box under target membership to include it as part of the project.

Solution 6 - Ios

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

Solution 7 - Ios

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.

Solution 8 - Ios

Unfortunately or fortunately, the error specified is very accurate. There is only one option available right now. i.,e placing Google-Info.plist file in your project properly. Try to remove and add that again. Also, check if a target is selected or not.

Solution 9 - Ios

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.

Solution 10 - Ios

  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.

Solution 11 - Ios

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.

Solution 12 - Ios

Below setting can fix my compiler fail

  1. Add to "Copy Files"
  2. Not add to "Copy Bundle Resources"

enter image description here

Solution 13 - Ios

enter image description here

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

Solution 14 - Ios

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

Solution 15 - Ios

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

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

Solution 16 - Ios

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.

Solution 17 - Ios

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.

Solution 18 - Ios

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.

Solution 19 - Ios

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

Solution 20 - Ios

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.

Solution 21 - Ios

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)

Solution 22 - Ios

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

Solution 23 - Ios

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]]
];

Solution 24 - Ios

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!

Solution 25 - Ios

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

Solution 26 - Ios

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

Solution 27 - Ios

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 :)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionadam eliezerovView Question on Stackoverflow
Solution 1 - Iosharshal jadhavView Answer on Stackoverflow
Solution 2 - IosArjun KalidasView Answer on Stackoverflow
Solution 3 - IosAndrew KoView Answer on Stackoverflow
Solution 4 - IoskakubeiView Answer on Stackoverflow
Solution 5 - IosSteveView Answer on Stackoverflow
Solution 6 - IosNasir KhanView Answer on Stackoverflow
Solution 7 - IosRaunak PriyaView Answer on Stackoverflow
Solution 8 - IosSivajee BattinaView Answer on Stackoverflow
Solution 9 - IosShahzaib MaqboolView Answer on Stackoverflow
Solution 10 - IosAshviniView Answer on Stackoverflow
Solution 11 - IosBennybearView Answer on Stackoverflow
Solution 12 - IosJimmyChangView Answer on Stackoverflow
Solution 13 - IosjunnyeaView Answer on Stackoverflow
Solution 14 - IosClaytroniconView Answer on Stackoverflow
Solution 15 - Ioslalit MaheshwariView Answer on Stackoverflow
Solution 16 - IosWingsView Answer on Stackoverflow
Solution 17 - IoskurupareshanView Answer on Stackoverflow
Solution 18 - Iosactive_sludgeView Answer on Stackoverflow
Solution 19 - IosAkshaykumar MaldhureView Answer on Stackoverflow
Solution 20 - IosHarbi2020View Answer on Stackoverflow
Solution 21 - IosStanislau BuzunkoView Answer on Stackoverflow
Solution 22 - IosAsync-View Answer on Stackoverflow
Solution 23 - IosDmitry YudakovView Answer on Stackoverflow
Solution 24 - IosSylithView Answer on Stackoverflow
Solution 25 - IosFaisal KhawajView Answer on Stackoverflow
Solution 26 - IosBeyza karadenizView Answer on Stackoverflow
Solution 27 - IosMourbat SalimView Answer on Stackoverflow