I am using Google Sign-In SDK 4.0.1. When I press googleSignInButton then app will be crash. And gave below error, how to fix this:
Terminating app due to un
you have to add reversed client id instead of normal one.
in GoogleSignIn SDK 5.0
add code
GIDSignIn.sharedInstance().delegate = self
GIDSignIn.sharedInstance().presentingViewController = self
instead of this code
GIDSignIn.sharedInstance().delegate = self
GIDSignIn.sharedInstance().uiDelegate = self
I got that crash too. But selected answer did not help me.
Double check that:
In AppDelegate
straight DNS:
GIDSignIn.sharedInstance().clientID = "536164374389-ivga9a9at2g31nfmhpvdyhc98yf6afnr.apps.googleusercontent.com"
In Info.plist
reverse DNS:
<string>com.googleusercontent.apps.536164374389-ivga9a9at2g31nfmhpvdyhc98yf6afnr</string>
You have to add a URL scheme to your project
https://developers.google.com/identity/sign-in/ios/start-integrating#add_a_url_scheme_to_your_project
I've also waste over 4hours for similar logs (I'm developing ios app by flutter with VScode)
For me the main problem was GoogleService-Info.plist was not truly in the Runner directory.
I MUST had to add the GoogleService-Info.plist by XCODE, by right clicking Runner and add files button.
For overall, I learn that The flutter debugger(or vscode plugin?) does not give full information about the error.
Please look this for more information https://github.com/flutter/flutter/issues/22536
Check this image for what the 'Right clicking Runner and than add files'
As the error clearly says, your app is missing support for the url schemes.
Add the following schemes to your info.plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>***Your bundle ID***</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.googleusercontent.apps.107731993306-6s44u18onibp6gi0ddj94si1aifshhg6</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<string>***Something here***</string>
</array>
</dict>
</array>
Check this url for your id => https://developers.google.com/identity/sign-in/ios/start-integrating
Your info.plist should look like ->