skip to Main Content

This is the error message that i am getting, whenever i try to use google sign in (This issue doesn’t happen in debug, release and profile versions of the app. It only happens at the version (aab) that i upload to the google playstore):

PlatformException(sign_in_failed, e5.b: 10:, null, null)

Here is everything google related in my pubspec.yaml file:

 google_mobile_ads: ^3.0.0
 google_sign_in: ^6.1.1
 google_sign_in_dartio: ^0.2.2+1
 googleapis: ^10.1.0
 firebase_core: ^2.13.0
 firebase_messaging: ^14.6.5

These are the codes that i use to implement google sign in to my app:

API CALL:

class ThirdPartyService extends AppService {
  static ThirdPartyService get instance => ThirdPartyService();

  ThirdPartyService() : super(path: '');

  static final googleSignInInstance = GoogleSignIn(
    serverClientId:
        'MY_CLIENT_ID',
  );

  Future signInWithGoogle() async {
    final gUser = googleSignInInstance.currentUser ?? await googleSignInInstance.signIn();
    if (gUser != null) {
      final gAuthEmail = gUser.email;
      final token = (await gUser.authentication).accessToken;
      var response = await post('/OAUTH/GOOGLE', {
        "EMAIL_ADDRESS": gAuthEmail,
        "TOKEN": token,
      });
      if (!response.success) throw response.message;
      return AppData.userDetail.value = {...response.data};
    }
    throw 'GoogleSignInFailed';
  }
}

------------------

GOOGLE SIGN IN FUNCTION:

void loginWithGoogle() async {
    try {
      await ThirdPartyService.instance.signInWithGoogle();
      Get.offAll(
        () => RateAppInitWidget(
          builder: (rateMyApp) => BottomNavBar(rateMyApp: rateMyApp),
        ),
      );
    } catch (e) {
      Get.snackbar(
        'Warning',
        'Google Sign in failed. Try again later.',
        colorText: AppColors.black,
        backgroundColor: AppColors.white,
        duration: const Duration(seconds: 5),
      );
    }
  }

How can i fix this issue? Please help 😓

P.S: My app is approved and verified by google and i’ve tried many solutions related to SHA1 keys.

Hello, I’ve followed every step of implementing google sign in to my app (firebase steps, google consoles, in app configurations etc etc). Even though the google sign in is working correctly in debug, release and profile versions. It doesn’t work when i upload the aab to the google playstore. I’ve searched through many solutions and literally tried most if not every fix that i could find but the issue persists.

2

Answers


  1. You need to setup the different SHA-1 keys for production and to be able to do that you should read this article

    https://medium.com/@hamza.azee91/google-sign-in-into-your-android-app-step-by-step-57550e6e9398

    You’ll see the guide on how to do the google cloud API console and also on the firebase console.

    Login or Signup to reply.
  2. I am Facing the same issue tried everything mentioned above. Still the issue is not getting fixed the weird thing is the google sign in is working flawlessly on IOS Devices the issue im only facing is on ANDROID devices.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search