Google sign in was working fine with Xcode 7. After updating to Xcode 8, I started getting the error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'You must specify |clientID| for |GIDSignIn|'
. I have a GoogleService-Info.plist file with my CLIENT_ID.
I was able to fix it by adding the following line:
GIDSignIn.sharedInstance().clientID = "<CLIENT_ID>"
It seems the CLIENT_ID isn't being fetched from GoogleService-Info.plist. I've made sure it's in the Copy Bundle Resources.
I shouldn't have to specify the client id in the code. How can I fix it to get the information from the GoogleService-Info.plist file?
You can do it this way.
Swift:
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
Objective-C:
GIDSignIn.sharedInstance.clientID = FIRApp.defaultApp.options.clientID;
Please make sure you have these code place in sequence.
FirebaseApp.configure()
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID
GIDSignIn.sharedInstance().delegate = self
FirebaseApp.app()?.options.clientID
will only able to get data from GoogleService-Info.plist after FirebaseApp.configure()
is called.
I had the same problem. Actually GoogleServices-Info.plist
had been updated in my case.
I re-downloaded GoogleServices-Info.plist
and updated it with the older one which fixed the issue for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With