Home > OS >  Firebase Auth UI not working on Windows Subsystem for Android
Firebase Auth UI not working on Windows Subsystem for Android

Time:02-03

I'm trying to run my app on Windows Subsystem for an Android emulator. Everything works fine except for the authentication.

Libraries used:

'com.firebaseui:firebase-ui-auth:8.0.2'
'com.google.firebase:firebase-bom:31.2.0'

My code:

    activity.startActivityForResult(
            AuthUI.getInstance()
                    .createSignInIntentBuilder()
                    .setAvailableProviders(Arrays.asList(
                            new AuthUI.IdpConfig.EmailBuilder().build(),
                            new AuthUI.IdpConfig.GoogleBuilder().build()
                    ))
                    .setTosAndPrivacyPolicyUrls(activity.getString(R.string.terms_and_conditions_url)
                            ,activity.getString(R.string.privacy_policy_url))
                    .setLogo(R.drawable.app_icon_512)
                    .setIsSmartLockEnabled(false)
                    .build(),
            C.CODE_AUTH_REQUEST);

It won't start the authentication activity, and I'm getting the following errors:

[package name] requires the Google Play Store, but it is missing.

The service for com.google.android.gms.internal.auth-api.zbo is not available: ConnectionResult{statusCode=SERVICE_INVALID, resolution=null, message=null}

I suppose this happens because Google Play Services is not installed on the Windows Emulator.

However, from the Firebase docs, we can see that Google Play Services is not mandatory for Auth or other services. https://firebase.google.com/docs/android/android-play-services#play-services-required-summary

Has anyone run into the same problem?

CodePudding user response:

Since you're calling:

new AuthUI.IdpConfig.GoogleBuilder().build()

It means that you want to enable Firebase sign-in with Google, which indeed requires the Google Play services library to be installed.

  • Related