App getting crash when click on GoogleSignIn button

后端 未结 8 653
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 15:54

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         


        
相关标签:
8条回答
  • 2020-12-01 16:01

    you have to add reversed client id instead of normal one.

    0 讨论(0)
  • 2020-12-01 16:10

    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

    0 讨论(0)
  • 2020-12-01 16:13

    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>
    
    0 讨论(0)
  • 2020-12-01 16:16

    You have to add a URL scheme to your project

    1. Open your project configuration: double-click the project name in the left tree view. Select your app from the TARGETS section, then select the Info tab, and expand the URL Types section
    2. Click the + button, and add a URL scheme -com.googleusercontent.apps.107731993306-6s44u18onibp6gi0ddj94si1aifshhg6

    https://developers.google.com/identity/sign-in/ios/start-integrating#add_a_url_scheme_to_your_project

    0 讨论(0)
  • 2020-12-01 16:18

    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'

    0 讨论(0)
  • 2020-12-01 16:22

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

    0 讨论(0)
提交回复
热议问题