While debugging login issues where we‘d call Firebase Auth’s signinWithProvider it would always open the external browser (with all implications the comes with). It would not show any error but silently fail without any indication as to why.

There’s this shortened snippet here that gives deeper insight, but the implementation of isChromeCustomTabsAvailable() remains unknown.

Debugging further into it1, we found that the package manager deliberately returns false results (for privacy reasons) if you target Android 11 or later.

<queries>
    <intent>
        <action android:name="android.support.customtabs.action.CustomTabsService" />
    </intent>
</queries>

After having added the intent query declaration to the AndroidManifest.xml the Chrome CustomTab is finally used for the sign in.

The firebase-auth lib already comes with a declaration for their GenericIdpActivity that is then merged into the apps Manifest. But not with a Query one.

I hope that if you ever encounter this issue yourself, you’ll find this post and don’t have to use the debugger.

  1. Which is harder than it sounds because the code doesn’t properly decompile. And Google for obvious reasons has no interest to fix the tooling to reverse their security critical libs.