In some android devices like android 10 my app crashes when i enter phone number and call following method
PhoneAuthProvider.verifyPhoneNumber(options);
as you can see log report recaptcha activity is not resuming due to some null pointer issue
java.lang.RuntimeException: Unable to resume activity {com.horizam.businessclient/com.google.firebase.auth.internal.RecaptchaActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.internal.firebase-auth-api.zzat com.google.android.gms.internal.firebase-auth-api.zzdk.zza()' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4411)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4443)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.internal.firebase-auth-api.zzat com.google.android.gms.internal.firebase-auth-api.zzdk.zza()' on a null object reference
at com.google.firebase.auth.internal.zzk.zzb(com.google.firebase:firebase-auth@@20.0.1:2)
at com.google.firebase.auth.internal.RecaptchaActivity.zzd(com.google.firebase:firebase-auth@@20.0.1:10)
at com.google.android.gms.internal.firebase-auth-api.zzth.<init>(com.google.firebase:firebase-auth@@20.0.1:13)
at com.google.firebase.auth.internal.RecaptchaActivity.onResume(com.google.firebase:firebase-auth@@20.0.1:43)
at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1454)
at android.app.Activity.performResume(Activity.java:8103)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4401)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4443)
at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)
Thanks in advance if you sort this out for me.
Okay I found solution to this problem. There was nothing wrong with code. It was Android Device that was not allowing browser to open to show Recaptcha screen. It is working now perfectly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.