Q:

You must specify |clientID| for |GIDSignIn| error when trying to sign in with Google

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?

A:

You can do it this way.
Swift:
GIDSignIn.sharedInstance().clientID = FirebaseApp.app()?.options.clientID

Objective-C:
GIDSignIn.sharedInstance.clientID = FIRApp.defaultApp.options.clientID;

A:

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.

