148

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?

KENdi
  • 7,576
  • 2
  • 16
  • 31
adam eliezerov
  • 2,185
  • 2
  • 11
  • 17
  • 13
    check target is checked or not by clicking Plist file on right panel & also check physical location is in your project folder – Prashant Tukadiya Jul 26 '17 at 04:58
  • Please remove `GoogleService-Info.plist` from your project and try to add again. – Sanjay Shah Jul 26 '17 at 04:58
  • @MikeAlter Does it maybe have to do with the fact that i am running xcode 9 beta 4? – adam eliezerov Jul 26 '17 at 05: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 '17 at 18:40

31 Answers31

308

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

Elia Weiss
  • 8,324
  • 13
  • 70
  • 110
harshal jadhav
  • 5,456
  • 2
  • 18
  • 26
  • 16
    Also make sure the `Google-Info.plist` file has the right Target Memberships. – Tom Spee Sep 19 '17 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? – André Kuhlmann Oct 12 '17 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 '18 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. – Olkunmustafa Dec 30 '19 at 08:07
  • If you are using flutter, add the file to runner. Thanks for the solution – Shady Mohamed Sherif Aug 18 '20 at 01:31
  • As of Nov 2021, drag and dropping the file works fine for me. Perhaps they have fixed the bug. – Gapton Nov 29 '21 at 04:05
  • In Flutter project added .info file in Runner folder using Xcode solved issue – jagadishlakkurcom jagadishlakk Jun 16 '22 at 17:12
38

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

Arjun Kalidas
  • 919
  • 9
  • 14
29

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

Andrew Ko
  • 291
  • 3
  • 2
9

enter image description here

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

junnyea
  • 471
  • 6
  • 8
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.

kakubei
  • 5,321
  • 4
  • 44
  • 66
  • 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 02 '23 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.

Raunak Priya
  • 111
  • 1
  • 3
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.
Steve
  • 4,372
  • 26
  • 37
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.

Sivajee Battina
  • 4,124
  • 2
  • 22
  • 45
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.

Alexander Thiele
  • 657
  • 5
  • 13
3

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

Nasir Khan
  • 723
  • 4
  • 12
  • 24
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.

Shahzaib Maqbool
  • 1,479
  • 16
  • 25
  • Thank you. Mine was named GoogleService-info instead of Info. Oh the headache this caused me! – Anish Apr 22 '20 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.

Ashvini
  • 342
  • 3
  • 11
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.

Bennybear
  • 335
  • 2
  • 13
2

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

enter image description here

JimmyChang
  • 101
  • 1
  • 4
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.
active_sludge
  • 216
  • 2
  • 5
  • Make sure the target is selected for the GoogleService-Info.plist and is same as the target you are building upon. – Swati Mar 28 '20 at 09:42
1

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

Claytronicon
  • 1,437
  • 13
  • 14
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.

Wings
  • 2,398
  • 23
  • 46
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.

adiga
  • 34,372
  • 9
  • 61
  • 83
kurupareshan
  • 123
  • 2
  • 8
1

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

1

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
BigMcLargeHuge
  • 476
  • 1
  • 5
  • 9
0

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

Akshaykumar Maldhure
  • 1,239
  • 1
  • 18
  • 32
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)

Stanislau Buzunko
  • 1,630
  • 1
  • 15
  • 27
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

Async-
  • 3,140
  • 4
  • 27
  • 49
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]]
];
Dmitry Yudakov
  • 15,364
  • 4
  • 49
  • 53
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!

bad_coder
  • 11,289
  • 20
  • 44
  • 72
Sylith
  • 411
  • 4
  • 10
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.

yasin89
  • 103
  • 8
0

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

Santosh
  • 1,275
  • 1
  • 10
  • 21
-1

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