153

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?

4
  • 14
    check target is checked or not by clicking Plist file on right panel & also check physical location is in your project folder Jul 26, 2017 at 4:58
  • Please remove GoogleService-Info.plist from your project and try to add again. Jul 26, 2017 at 4:58
  • @MikeAlter Does it maybe have to do with the fact that i am running xcode 9 beta 4? Jul 26, 2017 at 5:37
  • the betas were buggy in that: quite simply they often did not automatically add the item to the target this applied to images, scripts, whatever. very simply - choose "info" on the right and click the "add to target" box. it seems to have been all fixed in X9 release.
    – Fattie
    Sep 29, 2017 at 18:40

31 Answers 31

318

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

EDIT: this is how you remove a plist file Xcode 10 Error: Multiple commands produce

7
  • 17
    Also make sure the Google-Info.plist file has the right Target Memberships.
    – Tom Spee
    Sep 19, 2017 at 11:24
  • Is that's a bug that you can't just drag and drop the file or is the "Add Files" method something different from normal dragging and dropping? Oct 12, 2017 at 20:38
  • 1
    @AndréKuhlmann It seems to be that the Drag and drop the file is the bug. When I dragged the plist file into my project's root directory, the file location is the path from the Downloads folder. So I had to "Add Files" for it to work.
    – govgo
    Apr 23, 2018 at 18:16
  • I tried this method but Google-Info.plist created in the root file. I drag/drop Google-Info.plist file in my app folder manually. I did it for React-Native project. Dec 30, 2019 at 8:07
  • If you are using flutter, add the file to runner. Thanks for the solution Aug 18, 2020 at 1:31
40

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

1
  • In my case its disabled i cant check that i have only option to check {projectname}Tests Sep 30, 2021 at 6:55
30

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

1
  • This worked for me. I got here after I ran "Clean Build Folder" and the application continued to crash Jul 20, 2023 at 18:38
12

enter image description here

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

0
6

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.

1
  • Also, when you are adding the files to the project, make sure you select "Create groups" and not "Create folder references". If you use folder references then the folder reference will manage the target membership, which resulted in Firebase not finding the plist, causing a crash on launch. You have to select the target membership on the files directly.
    – blwinters
    Jun 2, 2023 at 15:22
6

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.

1
  • 2
    Yeah I had this issue with copies like "GoogleService-Info2.plist" Jan 6, 2021 at 16:53
5
  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.
2
  • can we rename this file name : GoogleService-info.plist ? To something like GoogleService-info_myapp.plist Dec 20, 2018 at 10:14
  • This solved it. There was issue in file naming , check the file name for the service-info.plist
    – Ankit J
    Apr 24, 2021 at 18:22
4

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.

1
  • where is the project property? Jul 26, 2017 at 5:32
4

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.

3

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

2

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.

1
  • Thank you. Mine was named GoogleService-info instead of Info. Oh the headache this caused me!
    – Anish
    Apr 22, 2020 at 23:34
2
  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.

2

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.

2

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

enter image description here

0
2

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.
1
  • Make sure the target is selected for the GoogleService-Info.plist and is same as the target you are building upon.
    – Swati
    Mar 28, 2020 at 9:42
2

I know this question has a million answers already, but perhaps this solution will help someone who isn't using Xcode build configs like many answers above.

If you're converting an iOS app to Catalyst (as I am), then I found a minor but obtuse difference is Catalyst apps make bundles with a "Content/Resources" folder structure that was throwing off my builds for a while. My build phases copy my release/debug Plist files for me and the pathing difference from iOS -> Catalyst was causing this error.

You can probably solve this problem many ways, like the multiple folders with same named Plist files above. I use a custom bash script via build phases, and copy the file manually like this:

if [ $CONFIGURATION == "Debug" ]; then
echo using DEBUG firebase!

# Mac Catalyst appends a "Contents" folder so we need to handle that explicitly here
if [ $IS_MACCATALYST ]; then
    #echo "MAC CATALYST BUILD"
    cp ${SRCROOT}/${PROJECT-DIR}/your-custom-paths-here/GoogleService-Info.plist ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app/Contents/Resources/GoogleService-Info.plist
else
 cp ${SRCROOT}/${PROJECT-DIR}/firebase/debug/GoogleService-Info.plist ${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app
fi 
fi
1

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

1

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

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

1

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.

1

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.

1

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

0

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

0

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.

0

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)

0

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

0

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

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!

0

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

0

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.

0

Just drag and drop the file into terminal, don't copy paste from Notes or TextEdit or from elsewhere.

Not the answer you're looking for? Browse other questions tagged or ask your own question.