Skip to content

Firebase Test Lab robo test Google sign in fails with FirebaseUI Authentication #1928

Description

@NabeelJ-Git

Step 2: Describe your environment

Since my question pertains to the Firebase Test Lab Robo environment the device and OS Version below are details of the device that ran my APK:

  • Android device: Google Pixel
  • Android OS version: API 26/O
  • Google Play Services version: 4.3.5
  • Firebase/Play Services SDK version: 26.5.0
  • FirebaseUI version: 6.4.0

Step 3: Describe the problem:

Firebase Test Lab Robo test fails to sign into app using the FirebaseUI Auth Google sign in button. The test taps the Sign in with Google button in the app, then taps an x@cloudtestlabaccounts.com email from the account picker, then the app crashes immediately. The resulting log gives a Developer error: saying "this application is misconfigured. Check your SHA1 and package name in the Firebase console." However I already added the 3 SHA-1 keys necessary for Google Sign In to work (debug, release and Play App Signing) and strangely enough I am able to sign in with Google just fine on all builds. This issue means Google Play's Pre-launch Report also fails. My theory is that it fails due to the @cloudtestlabaccounts.com domain being used instead of an @gmail.com one but I'm not so sure. Is there a setting I'm missing? Or an extra SHA-1 key somewhere that needs to be added? I apologize if this question isn't directly related to FirebaseUI, not sure where else to ask.

Steps to reproduce:

  1. Add the 3 SHA-1 keys needed for Google sign in (debug, release and Play App Signing) to your Firebase console and add the resulting google-services.json file to your project.
  2. Add code to an activity to start the FirebaseUI Authentication screen with Google as at least one of the providers.
  3. Build an App Bundle and load that into Firebase Test Lab onto a Google Pixel (or any device, I tested this on a Motorola One/API 28 and LG-H932/API 26 and observed the same behavior). Observe that the Google sign in using the @cloudtestlabaccounts fails and the resulting log displays the message below.

Observed Results:

W/GoogleSignInHandler(12987): Developer error: this application is misconfigured. Check your SHA1 and package name in the Firebase console.
E/AuthUI(12987): A sign-in error occurred.
E/AuthUI(12987): com.firebase.ui.auth.FirebaseUiException: Code: 10, message: 10: 
E/AuthUI(12987): 	at com.firebase.ui.auth.data.remote.GoogleSignInHandler.onActivityResult(GoogleSignInHandler.java:112)
E/AuthUI(12987): 	at com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity.onActivityResult(AuthMethodPickerActivity.java:383)
E/AuthUI(12987): 	at android.app.Activity.dispatchActivityResult(Activity.java:7235)
E/AuthUI(12987): 	at android.app.ActivityThread.deliverResults(ActivityThread.java:4320)
E/AuthUI(12987): 	at android.app.ActivityThread.handleSendResult(ActivityThread.java:4367)
E/AuthUI(12987): 	at android.app.ActivityThread.-wrap19(Unknown Source:0)
E/AuthUI(12987): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1649)
E/AuthUI(12987): 	at android.os.Handler.dispatchMessage(Handler.java:105)
E/AuthUI(12987): 	at android.os.Looper.loop(Looper.java:164)
E/AuthUI(12987): 	at android.app.ActivityThread.main(ActivityThread.java:6541)
E/AuthUI(12987): 	at java.lang.reflect.Method.invoke(Native Method)
E/AuthUI(12987): 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
E/AuthUI(12987): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

Expected Results:

Since I have all my SHA-1 keys set properly I would expect the robo test to sign in successfully or throw a different Exception that doesn't imply it's the developers fault (unless it is and I'm doing something completely wrong!).

Relevant Code:

public class SignInActivity extends AppCompatActivity {

  private final int RC_SIGN_IN = 777;
  private FirebaseAuth auth;

  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);

      auth = FirebaseAuth.getInstance();

      if(auth.getCurrentUser() == null){
          showFirebaseUI();
      }
      else {
          startActivity(new Intent(this, MainActivity.class));
      }
  }

  public void showFirebaseUI() {
      List<AuthUI.IdpConfig> providers = Arrays.asList(
              new AuthUI.IdpConfig.EmailBuilder().build(),
              new AuthUI.IdpConfig.GoogleBuilder().build());

      startActivityForResult(
              AuthUI.getInstance()
                      .createSignInIntentBuilder()
                      .setAvailableProviders(providers)
                      .setIsSmartLockEnabled(false)
                      .setLogo(R.mipmap.ic_launcher_round)
                      .build(),
              RC_SIGN_IN);
  }


  @Override
  protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
      super.onActivityResult(requestCode, resultCode, data);

      if (requestCode == RC_SIGN_IN) {
          if (resultCode == RESULT_OK) {
              startActivity(new Intent(SignInActivity.this, MainActivity.class));
          }
          finish();
      }

  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions