PlatformException(sign_in_failed, com.google.android.gms.common.api...: 10: , null, null)

PlatformException(sign_in_failed, com.google.android.gms.common.api...: 10: , null, null)

    When you try to Google login on your Flutter app, you may get the error below

    PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)

    Based on my experience and experiment, there could at least four reasons that you got this error

    Enable Google Login

    If you are using Firebase for google login and authentication, you have to register you app, with firebase. For registering, you need to create firebase projects and apps. 

    You need to enable Google login or login provider in the firebase console. Otherwise you won't be able to login.

    Google Service json file

    Make sure you have firebase app for Android and iOS. Once you create the project, you have to download the GoogleService-Info.plist for iOS and google-services.json for Android.

    Make sure that, you have them ready in correct place. For iOS GoogleService-Info.plist should be inside 

    For Android make sure you have the file in below location

    SHA1 & SHA256 Fingerprint

    You need to create SHA1 & SHA256 fingerprint key for you app. To do it, you need to make sure you Java Key Tool installed in your machine.

    Google Play Store

    You need to make sure in your emulator you have Google play store installed. Otherwise you won't be able to login with Google service.

    The above four steps if you do correctly, you won't have any problem. If first time, did not work make sure to delete the app from emulator and redo again.

    Courses


    Recommended posts


    Recent posts