Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS : invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options #308

Closed
JCornat opened this issue May 17, 2017 · 45 comments

Comments

@JCornat
Copy link

JCornat commented May 17, 2017

Hello,

I have a Firebase project where I have downloaded the iOS and Android configuration files.
It works on Android, but on iOS launch, the app just crashes and here is the log.

I have checked the GoogleService-Info.plist, re-downloaded, but everytime, I got this error.

2017-05-17 12:06:45.541 BioContact[4304] <Debug> [Firebase/Core][I-COR000001] Configuring the default app.
2017-05-17 12:06:45.542 BioContact[4304] <Error> [Firebase/Core][I-COR000009] The GOOGLE_APP_ID either in the plist file 'GoogleService-Info.plist' or the one set in the customized options is invalid. If you are using the plist file, use the iOS version of bundle identifier to download the file, and do not manually edit the GOOGLE_APP_ID. You may change your app's bundle identifier to '(null)'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.
2017-05-17 12:06:45.547 BioContact[4304:6763094] *** Terminating app due to uncaught exception 'com.firebase.core', reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.'
*** First throw call stack:
(
	0   CoreFoundation                      0x000000010705db0b __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000106a99141 objc_exception_throw + 48
	2   CoreFoundation                      0x00000001070c6625 +[NSException raise:format:] + 197
	3   BioContact                          0x0000000105f0598d +[FIRApp addAppToAppDictionary:] + 371
	4   BioContact                          0x0000000105f04f38 +[FIRApp configureDefaultAppWithOptions:sendingNotifications:] + 285
	5   BioContact                          0x0000000105f04c6c +[FIRApp configure] + 302
	6   BioContact                          0x0000000105ea49ff -[AppDelegate(MCPlugin) application:customDidFinishLaunchingWithOptions:] + 767
	7   UIKit                               0x0000000107e36957 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 299
	8   UIKit                               0x0000000107e3823c -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4119
	9   UIKit                               0x0000000107e3e584 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
	10  UIKit                               0x0000000107e3b793 -[UIApplication workspaceDidEndTransaction:] + 182
	11  FrontBoardServices                  0x000000010c7b45f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
	12  FrontBoardServices                  0x000000010c7b446d -[FBSSerialQueue _performNext] + 186
	13  FrontBoardServices                  0x000000010c7b47f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
	14  CoreFoundation                      0x0000000107003c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
	15  CoreFoundation                      0x0000000106fe90cf __CFRunLoopDoSources0 + 527
	16  CoreFoundation                      0x0000000106fe85ff __CFRunLoopRun + 911
	17  CoreFoundation                      0x0000000106fe8016 CFRunLoopRunSpecific + 406
	18  UIKit                               0x0000000107e3a02f -[UIApplication _run] + 468
	19  UIKit                               0x0000000107e400d4 UIApplicationMain + 159
	20  BioContact                          0x0000000105dc40a1 main + 65
	21  libdyld.dylib                       0x000000010986c65d start + 1
	22  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Can you help me understand why Firebase crashes on iOS ?

Thank you !

@larssn
Copy link

larssn commented May 17, 2017

GoogleService-Info.plist usually becomes corrupted for whatever reason.

Check platforms/ios/<Your Project>/Resources/ and platforms/ios/<Your Project>/Resources/Resources

There should be a GoogleService-Info.plist in both locations. One of these should be corrupt. Usually its the one furthest in.

Replace that one, and it should work.

@JCornat
Copy link
Author

JCornat commented May 17, 2017

I have replaced the file in both folders and it works, thank you !

@JCornat JCornat closed this as completed May 17, 2017
@codinronan
Copy link

Wow this is obscure and even more amazing that someone knew the solution. You just saved me... countless hours, @larssn .

@nitin7dc
Copy link

nitin7dc commented Jul 6, 2017

@larssn super thanks !

@rolinger
Copy link

rolinger commented Aug 6, 2017

holy sweet jesus batman!!!!!!!!! Like @codinronan said, this completely obscure solution fixed my issue. and I am not even using the FCM plugin, I am using the Firebase plugin. Rebuilt my app project from scratch and the problem still persisted...until I found this solution!!!!

thank you....Thank You....THANK YOU!!!!

@shanmicheal25
Copy link

shanmicheal25 commented Sep 6, 2017

Terminating app due to uncaught exception 'com.firebase.core', reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.'
*** First throw call stack:
(0x184096fe0 0x182af8538 0x184096f28 0x100145600 0x100144ba8 0x1001448d0 0x1000c16c0 0x18a239e48 0x18a44637c 0x18a44be24 0x18a4608b0 0x18a4490b8 0x185c40884 0x185c406f0 0x185c40aa0 0x18404542c 0x184044d9c 0x1840429a8 0x183f72da4 0x18a232fc8 0x18a22dc9c 0x1000bee34 0x182f8159c)
libc++abi.dylib: terminating with uncaught exception of type NSException

I tried the solution, I copied GoogleService-Info.plist file into project resources folder, but still i'm facing same problem. Any one have solution

@vanschroeder
Copy link

vanschroeder commented Sep 7, 2017

@shanmicheal25 be sure to overwrite the .plist file under platforms/ios/< Your Project >/Resources/Resources with the .plist file from your root

At least that made all the difference to me

@Junior-iOS
Copy link

Sorry, guys.
Where do I find the path platforms/ios?

@satryacode
Copy link

satryacode commented Oct 4, 2017

@Junior-iOS it's in Cordova Project root folder
the folder created after you add platform in it
by running this command in your console cordova platform add ios

@PredragJ
Copy link

PredragJ commented Oct 11, 2017

@for Xcode 9, solution is to check box at Target Membership Tab on GoogleService-Infp.plist

@Geeksquid04
Copy link

where do you find the platforms folder?

@sKuD51
Copy link

sKuD51 commented Oct 18, 2017

Same problem, I dont know why, but I replace my olds GoogleService-Info.plist in :

  • root folder
  • /platforms/ios/yourAppNameFolder/Resources
  • /platforms/ios/yourAppNameFolder/Resources/Resources

It works fine.

@Jhonsensf
Copy link

Same problem here. I replaced the files and it is working fine.

Thank you!

@TheNaderio
Copy link

In this File was no Informations:
/platforms/ios/yourAppNameFolder/Resources/Resource/GoogleService-Info.plist

So i copyed
this -> /platforms/ios/yourAppNameFolder/Resources/GoogleService-Info.plist
to here -> /platforms/ios/yourAppNameFolder/Resources/Resource/GoogleService-Info.plist

@Xam-Devender
Copy link

Thanks !!!!!!!!! Re-Downloaded -> Build and that's all it worked ... :)

@roshandhabekar
Copy link

roshandhabekar commented Mar 9, 2018

hello @larssn ,
I am building ionic ios,
i got the file at ,
/platforms/ios/yourAppNameFolder/Resources/GoogleService-Info.plist

but I don't have resources folder inside resources,
/platforms/ios/yourAppNameFolder/Resources/Resource/GoogleService-Info.plist
Can you please suggest me, which one should I replace.

Thanks!

@vanschroeder
Copy link

@roshandhabekar per the other comments above, just create the missing Resources folder and copy the GoogleService-info.plist file into place. If that doesn't work I would suggest ionic cordova platform rm ios and ionic cordova platform add ios which is typically an expedient way to correct platform specific issues

@jonathan-chin
Copy link

Thanks @larssn ! indeed, the deeper plist file was empty.

Any idea why this happens?

@larssn
Copy link

larssn commented Mar 14, 2018

@jonathan-chin I haven't digged into the code; I assume there's a bug in there somewhere.

@edugolive
Copy link

I found the problem.
These plugins, as well as the cordova-plugin-firebase, have the after-ready script, in this case scripts/fcm_config_files_process.js, which at line 20 tries to get the name of the project in this way (var name = getValue (config, 'name');).
And in the "getValue" method it tries to read the tag of the config.xml file.
That way (var value = config.match (new RegExp ('<' + name + '> (. *?) </' + Name + '>', 'i'));).
So if your config.xml file is described this way MyAppName</ name>, this will work.
Now if so, MyAppName</ name> will return as null.
That way when the rest of the script tries to do this (IOS_DIR + '/' + name + '/Resources/GoogleService-Info.plist'), this will result in "ios/null/Resources/GoogleService-Info.plist" that does not exist, and will not save the file.

Then leave the tag of config.xml in this way MyAppName and it will work.
Hug.

@coolvasanth
Copy link

I just removed the GoogleService-info.plist file from my project root folder and re added it, everything works fine now.

@robertohuertasm
Copy link

Why is this thread closed? It seems that the issue is still going on...

@mohitcis
Copy link

@larssn thanks, It worked for me :)

@madhurakhal
Copy link

I am having same problem. adding Resource with GoogleService-info.plist does not solve the problem. I am using XCode 10.1

@sibabratswain11
Copy link

@madhurakhal did you find any solution ?

@edugolive
Copy link

My tip is you start from scratch.
Delete all your android sdk files. open the android studio and download again the versions of sdk you need.
Delete your files from the node_modules folder and download it again.
Remove your plugins used in the project and download it again.
Build project again.
It worked for me.

@aryeharmon
Copy link

how can i add this solution to the config.xml?

@avaiyakirtib
Copy link

Replacing the .plist from platforms/ios/<Your Project>/Resources/ solved my problem

@devjva
Copy link

devjva commented Oct 14, 2019

Change the file permissions of the entire project, some files were read only.
it worked for me

@jdavidteki
Copy link

Is anyone getting this issue while using react-native?

@shabeer3508
Copy link

In this File was no Informations:
/platforms/ios/yourAppNameFolder/Resources/Resource/GoogleService-Info.plist

So i copyed
this -> /platforms/ios/yourAppNameFolder/Resources/GoogleService-Info.plist
to here -> /platforms/ios/yourAppNameFolder/Resources/Resource/GoogleService-Info.plist

you saved my day

@GiladR1979
Copy link

Is anyone getting this issue while using react-native?

Yes. This is not solved yet.
I get a crash on +[FIRApp addAppToAppDictionary:], using +[FIRApp configureWithOptions:] and specifying the .plist file (I have multiple schemes and targets).
Weirdly it only crashes when downloading app from TestFlight and not running with XCode, and only on old iPhones- iPhone 5,6,7.

@TylerByte666
Copy link

This still works as of 19/12/2019 you just made my Christmas ❤️
Thanks @larssn 🥇

@cyonusg
Copy link

cyonusg commented Jan 28, 2020

2020 and works yet !! @larssn

@Heckthor
Copy link

2020 in quarantine and the issue still exists and the workaround still works.
Thank you, @larssn
Maestro 🙌🏻

@kapilSoni101
Copy link

@larssn :i tried but its not working for me

@yellaiahd
Copy link

Dwonload from firebase console and place in. platforms/ios//Resources/ its resolved.

@ikishanoza
Copy link

I am using capacitor so there is no folder called "Resources" I have tried every solution which is mentioned here still having same issue. i am using lastest xcode version.

@itshazlan
Copy link

I am using capacitor so there is no folder called "Resources" I have tried every solution which is mentioned here still having same issue. i am using lastest xcode version.

same here still waiting for someone to solve this

@wlofgren
Copy link

i'm getting the same error using capacitor.

[Firebase/Core][I-COR000009] The GOOGLE_APP_ID either in the plist file 'GoogleService-Info.plist' or the one set in the customized options is invalid. If you are using the plist file, use the iOS version of bundle identifier to download the file, and do not manually edit the GOOGLE_APP_ID. You may change your app's bundle identifier to '(null)'. Or you can download a new configuration file that matches your bundle identifier from https://console.firebase.google.com/ and replace the current one.

*** Terminating app due to uncaught exception 'com.firebase.core', reason: 'Configuration fails. It may be caused by an invalid GOOGLE_APP_ID in GoogleService-Info.plist or set in the customized options.'

@Melf11
Copy link

Melf11 commented Sep 13, 2021

for Capacitor replace
/ios/capacitor-cordova-ios.plugins/resources/GoogleService-Info.plist

@Shery11
Copy link

Shery11 commented Nov 9, 2021

for Capacitor replace /ios/capacitor-cordova-ios.plugins/resources/GoogleService-Info.plist

This doesn't work. I am using capacitor and the latest code.

@felix-mittermeier
Copy link

If you still have this issue and replacing the files did not work make sure that your appID set in your custom options at Firebase.init really do match their specific platform.
The appIds look very similar to each other but are indeed DIFFERENT for every platform (iOS, Android, Web). So make sure to check the platform first and then set the corresponding id at the options.

@RomanSoviak
Copy link

If you develop the app on Flutter inside FirebaseOptions object you should differentiate this parameter:

...
  appId: Platform.isIOS
          ? "1:639*****:ios:e0*********"
          : "1:639******:android:032bd**********",

@EduardoIbarra
Copy link

for Capacitor replace /ios/capacitor-cordova-ios.plugins/resources/GoogleService-Info.plist

This did the trick for me. The file was there, but didn't have any property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests