Open hamza0786 opened 1 year ago
hey @hamza0786 check this issue https://github.com/a914-gowtham/LetsChat/issues/10
its same as it is but the app still crashed when click on get otp:
fun setMobile(country: Country, mobile: String) { Timber.v("Mobile $mobile") val number = country.noCode + " " + mobile val options = PhoneAuthOptions.newBuilder(auth) .setPhoneNumber(number) .setTimeout(60L, TimeUnit.SECONDS) .setActivity(actContxt) .setCallbacks(this) .build() PhoneAuthProvider.verifyPhoneNumber(options) }
Anyone plz help me to fix this issue.every time i run app in emulator and then click on get otp button the app got crashed.
D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.paksoft.letschat, PID: 13286 java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.getApplicationContext()' on a null object reference at android.content.ContextWrapper.getApplicationContext(ContextWrapper.java:122) at androidx.localbroadcastmanager.content.LocalBroadcastManager.getInstance(LocalBroadcastManager.java:107) at com.google.firebase.auth.internal.zzap.zza(com.google.firebase:firebase-auth@@20.0.0:18) at com.google.firebase.auth.internal.zzap.zza(com.google.firebase:firebase-auth@@20.0.0:8) at com.google.firebase.auth.internal.zza.zza(com.google.firebase:firebase-auth@@20.0.0:45) at com.google.firebase.auth.internal.zza.zza(com.google.firebase:firebase-auth@@20.0.0:57) at com.google.firebase.auth.internal.zzc.onFailure(com.google.firebase:firebase-auth@@20.0.0:3) at com.google.android.gms.tasks.zzl.run(Unknown Source:4) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7664) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)