I'm getting this error
Updated error:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: xxx.com.xxx, PID: 4963
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task
com.google.android.gms.common.api.GoogleApi.zzb(com.google.android.gms.common.api.internal.zzdf)'
on a null object reference
at com.google.android.gms.internal.zzdtp.zzb(Unknown Source)
at com.google.android.gms.internal.zzdtw.zza(Unknown Source)
at com.google.firebase.auth.FirebaseAuth.zza(Unknown Source)
at com.google.firebase.auth.PhoneAuthProvider.zza(Unknown Source)
at com.google.firebase.auth.PhoneAuthProvider.verifyPhoneNumber(Unknown
Source)
at xxx.com.xxx.PhoneNumberActivity.onClick(PhoneNumberActivity.java:110)
at android.view.View.performClick(View.java:5265)
at android.view.View$PerformClick.run(View.java:21534)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
When I try to run this code
PhoneAuthProvider.getInstance().verifyPhoneNumber(
phoneNumber, // Phone number to verify
60, // Timeout duration
TimeUnit.SECONDS, // Unit of timeout
this, // Activity (for callback binding)
mCallbacks); // OnVerificationStateChangedCallbacks
In app build.gradle
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.google.firebase:firebase-auth:11.6.0'
Why is it saying it's null? What is null? I'm running it on android device Android version 6.0. Is it because there's no sim card on the phone? I've already enabled phone authentication in the console and it's working on iOS.
Updates:
After Updating the version of firebase-core and firebasse-auth, the app doesn't crash any more.
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
Found out it's caused by version 8.3.01 (2385995-434) Google Play services of the phone I'm testing on. Any solution to make it work with 8.3.01?
Error:
" W/GooglePlayServicesUtil: Google Play services out of date. Requires 12451000 but found 8301434"
Question:
How to control the min Google Play services version?