Cordova Firebase Google Login: Error: The redirect operation has been cancelled by the user before finalizing

I tried to use Firebase to implement Google Sign-In for my cordova project:

<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-app.js" ></script>    
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-database.js" ></script>
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-auth.js" async></script>
<script src="https://www.gstatic.com/firebasejs/7.13.1/firebase-messaging.js" async></script>
//...

firebase.auth().signInWithRedirect(provider).then(function() {
   return firebase.auth().getRedirectResult();
}).then(function(result) {
   // This gives you a Google Access Token.
   // You can use it to access the Google API.
   var token = result.credential.accessToken;
   // The signed-in user info.
   var user = result.user;
   // ...
}).catch(function(error) {
   // Handle Errors here.
   var errorCode = error.code;
   var errorMessage = error.message;
   alert(errorMessage);
});

When I ran it on my Android phone, I got the following error, after a blank browser was automatically launched and closed:

Error: The redirect operation has been cancelled by the user before finalizing.

I made sure I have followed every instruction here and verified my Dynamic Link domain.

As suggested by a comment here, I also tried including the following line on the 'deviceready' event:

universalLinks.subscribe(null, function (eventData) {alert(eventData.url);});

which was not fired at all, which seems to suggest my setup of universal links was wrong.

I have the following in my config.xml:

<universal-links>
    <host name="xxx.host" scheme="https" />
    <host name="xxx-25960.firebaseapp.com" scheme="https">
        <path url="/__/auth/callback"/>
    </host>
</universal-links>

What am I missing?