Android crashing when OTP code is sent #13154
Unanswered
JesseLeDavis
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there, I'm running into an issue when the code is sent to an android phone it crashes the app with this error code seen below. I saw some answers to similar issues where they wanted to add some dependencies to the build.gradle (I will post below).
It only happens when it gets sent to a phone. If i have it send to a separate phone It causes no problems.
Exception java.lang.RuntimeException: at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0 (LoadedApk.java:1919) at android.app.LoadedApk$ReceiverDispatcher$Args.$r8$lambda$gDuJqgxY6Zb-ifyeubKeivTLAwk at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run at android.os.Handler.handleCallback (Handler.java:958) at android.os.Handler.dispatchMessage (Handler.java:99) at android.os.Looper.loopOnce (Looper.java:230) at android.os.Looper.loop (Looper.java:319) at android.app.ActivityThread.main (ActivityThread.java:8919) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103) Caused by java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference at java.util.regex.Matcher.reset (Matcher.java:386) at java.util.regex.Matcher.<init> (Matcher.java:210) at java.util.regex.Pattern.matcher (Pattern.java:989) at com.google.android.gms.internal.firebase-auth-api.zzadt.zza (com.google.firebase:firebase-auth@@22.3.1:3) at com.google.android.gms.internal.firebase-auth-api.zzadx.onReceive (com.google.firebase:firebase-auth@@22.3.1) at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0 (LoadedApk.java:1911)
Heres my logic that im using in my cubit.
await _authService.verify( phoneNumber: phoneNumber, verificationCompleted: (phoneAuthCred) async { final signUpResult = await _authService.androidSignUp( credential: phoneAuthCred, profilePhoto: state.image, firstName: state.firstName.value, lastName: state.lastName.value, gender: state.gender.value, ageRange: state.ageRange.value, email: state.email.value, ); signUpResult.fold((l) { emit( state.copyWith( formStatus: FormzStatus.submissionFailure, ), ); emit(state.copyWith(formStatus: FormzStatus.valid)); }, (r) { getIt<AuthenticationCubit>().authenticate(r); emit( state.copyWith( formStatus: FormzStatus.submissionSuccess, ), ); emit(state.copyWith(formStatus: FormzStatus.valid)); }); }, verificationFailed: (firebaseException) { emit(state.copyWith(formStatus: FormzStatus.submissionFailure)); emit(state.copyWith(formStatus: FormzStatus.valid)); }, codeSent: (verificationId, resendToken) { emit( state.copyWith( status: SignUpStatus.code, formStatus: FormzStatus.pure, resendToken: resendToken, verificationId: verificationId, ), ); }, codeAutoRetrievalTimeout: (verificationId) { emit(state.copyWith(verificationId: verificationId)); }, );
BUILD.GRADLE DEPENDENCIES
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10" coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4' implementation "androidx.browser:browser:1.8.0" implementation 'com.google.firebase:firebase-appcheck-playintegrity:16.0.0' implementation(platform("com.google.firebase:firebase-bom:33.1.0")) implementation("com.google.firebase:firebase-analytics") implementation "androidx.browser:browser:1.3.0" implementation "com.android.support:appcompat-v7:28.0.0" }
Beta Was this translation helpful? Give feedback.
All reactions