FirebaseUI-Android icon indicating copy to clipboard operation
FirebaseUI-Android copied to clipboard

When trying to start a Google login flow on this specific device I get ERROCODE 10

Open LukeDaniel16 opened this issue 3 years ago • 10 comments

Step 2: Describe your environment

  • Android device: Redmi 6
  • Android OS version: 9.0
  • Google Play Services version: lastest release updated
  • Firebase/Play Services SDK version: lastest release updated
  • FirebaseUI version: updated

Step 3: Describe the problem:

When trying to start a Google login flow on this specific device I get ERROCODE 10.

When I click on google login, the flow appears, I click on the google account that I want to login and the error code 10 occurs to me.

Steps to reproduce:

  1. Click on flow
  2. Click on account
  3. Error is happened, this error: ErrorCodes.EMAIL_LINK_CROSS_DEVICE_LINKING_ERROR

Expected Results:

  • What did you expect to happen? On other devices, such as the emulated S9 +, everything goes well and the login is carried out with complete success.

Relevant Code:

This code is the flow of logging with Google account on FirebaseAuth

protected void onStart() {
      super.onStart();
      GoogleSignInAccount account = GoogleSignIn.getLastSignedInAccount(this);
      if(account != null){
          //Toast.makeText(getApplicationContext(), "User already logged", Toast.LENGTH_LONG).show();
      }else{
          //Toast.makeText(getApplicationContext(), "New User", Toast.LENGTH_LONG).show();
      }
  }


      googleLogin.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {                startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder().setAvailableProviders(Collections.singletonList(new AuthUI.IdpConfig.GoogleBuilder().build())).build()
                      , REQUEST_LOGIN_GOOGLE); // This error occurs after this intent 
          }
      });

LukeDaniel16 avatar Oct 16 '20 14:10 LukeDaniel16

Example of error occurred on Google Firebase Test Lab devices, error code 10.

ezgif-7-1be95f5e6c6b

LukeDaniel16 avatar Oct 16 '20 16:10 LukeDaniel16

Update:

I just implemented using EXACTLY the example on the Android library website, inserting my key in a String in the application, however, the error persists, some devices log in successfully, others occur this error incessantly, until then without correction.

Link of example documentation android

LukeDaniel16 avatar Oct 16 '20 16:10 LukeDaniel16

I just noticed something else, my SHA1 key in firebase is DIFFERENT from my Play Console SHA1 key, can this conflict?

LukeDaniel16 avatar Oct 16 '20 18:10 LukeDaniel16

Capturar

Two keys, one generated from Gradle and other generated from Play Console app Bundles

LukeDaniel16 avatar Oct 16 '20 18:10 LukeDaniel16

@LukeDaniel16 yeah this does sound like it could be a SHA1 issue, have you made sure all of those different SHA1 are in the Firebase console?

Error Code 10 is likely from Google Sign In, not FirebaseUI, where it means DEVELOPER_ERROR: https://github.com/googlesamples/google-services/issues/360

samtstern avatar Oct 19 '20 15:10 samtstern

@LukeDaniel16 yeah this does sound like it could be a SHA1 issue, have you made sure all of those different SHA1 are in the Firebase console?

Error Code 10 is likely from Google Sign In, not FirebaseUI, where it means : googlesamples/google-services#360DEVELOPER_ERROR

I have a sure that every SHA-1 was added on Firebase Console, i checked the SHA-1 on Android Studio Gradle and check on Play Console too, i linked the playstore app to firebase, the error still goes on ... I'm lost, this basically only occurs on Xiaomi devices...

LukeDaniel16 avatar Oct 26 '20 19:10 LukeDaniel16

I think the option that I use in Android Studio may be incorrect, when generating the Bundle I use the Generate Signed Bundle option, maybe I shouldn't generate the signed bundle because the bundle is already signed automatically by Google Play Console, right? So I should use Build Bundle.

LukeDaniel16 avatar Oct 26 '20 19:10 LukeDaniel16

Same problem... Currently i believe that problem is in Firebase Test Lab that can't use Google Credentials correctly.

LukeDaniel16 avatar Oct 27 '20 14:10 LukeDaniel16

@LukeDaniel16 did you download the right google-services.json file and put it in app directory of your android app. When you add SHA in firebase console you have to download the latest google-services.json from firebase and add it to your app for the app to recognize you.

mirwisek avatar Nov 24 '20 08:11 mirwisek

Hi all, it looks like we do need to look into the exact SHA1s or credentials to help you further, and I'd suggest you reach out to Firebase Support instead, since it will be a bad idea to post credentials publicly on GitHub. Firebase Support can also help you with your project configuration.

yuchenshi avatar Nov 24 '20 23:11 yuchenshi