Environment
- Devices: multiple devices
- Android versions: 11–17
- FirebaseUI Auth:
10.0.0-beta03
- Firebase Auth:
24.0.1
Description
Our Android app crashes during Phone Authentication when Firebase automatically completes verification after detecting the SMS verification code.
The crash is fatal on the main thread and prevents affected users from signing in with SMS.
Steps to reproduce
-
Configure FirebaseUI Phone Auth:
AuthProvider.Phone(
defaultNumber = null,
defaultCountryCode = "<country>",
allowedCountries = listOf("<country>"),
)
-
Start phone number verification.
-
Receive the verification SMS.
-
In affected cases, Firebase automatically detects the SMS code and completes verification.
-
The app crashes.
Observed result
Fatal Exception: java.lang.IllegalStateException: Already resumed
at kotlin.coroutines.SafeContinuation.resumeWith(SafeContinuationJvm.kt:44)
at com.firebase.ui.auth.configuration.auth_provider.AuthProvider$Phone$DefaultVerifier$verifyPhoneNumber$2$options$1.onVerificationCompleted(AuthProvider.kt:418)
at com.google.firebase.auth.zzl.onVerificationCompleted(com.google.firebase:firebase-auth@@24.0.1:6)
at com.google.android.gms.internal.firebase-auth-api.zzaga.onVerificationCompleted(com.google.firebase:firebase-auth@@24.0.1:8)
at com.google.android.gms.internal.firebase-auth-api.zzafi.zza(com.google.firebase:firebase-auth@@24.0.1:2)
at com.google.android.gms.internal.firebase-auth-api.zzafn.run(com.google.firebase:firebase-auth@@24.0.1:4)
DefaultVerifier wraps Phone Auth callbacks with a single suspendCoroutine continuation. It resumes that continuation from onVerificationCompleted, onVerificationFailed, and onCodeSent.
The exception indicates that onVerificationCompleted attempted to resume a continuation that had already been completed by another callback. This may occur when onCodeSent is followed by SMS auto-retrieval.
Expected result
Phone verification should either complete automatically or transition to manual code entry without crashing. Any callback received after a terminal result should be safely ignored.
Environment
10.0.0-beta0324.0.1Description
Our Android app crashes during Phone Authentication when Firebase automatically completes verification after detecting the SMS verification code.
The crash is fatal on the main thread and prevents affected users from signing in with SMS.
Steps to reproduce
Configure FirebaseUI Phone Auth:
Start phone number verification.
Receive the verification SMS.
In affected cases, Firebase automatically detects the SMS code and completes verification.
The app crashes.
Observed result
DefaultVerifierwraps Phone Auth callbacks with a singlesuspendCoroutinecontinuation. It resumes that continuation fromonVerificationCompleted,onVerificationFailed, andonCodeSent.The exception indicates that
onVerificationCompletedattempted to resume a continuation that had already been completed by another callback. This may occur whenonCodeSentis followed by SMS auto-retrieval.Expected result
Phone verification should either complete automatically or transition to manual code entry without crashing. Any callback received after a terminal result should be safely ignored.