chemerisuk / cordova-plugin-firebase-authentication

Cordova plugin for Firebase Authentication
MIT License
98 stars 60 forks source link

verifyPhoneNumber fails since 4.0.2 (Android) #114

Closed ilbertt closed 3 years ago

ilbertt commented 3 years ago

I'm using the plugin in a Ionic + Capacitor application.

Since 4.0.2, I keep getting this error when calling verifyPhoneNumber:

2020-12-24 15:37:38.169 32171-32171/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: my.package.name, PID: 32171
    java.lang.RuntimeException: Unable to resume activity {my.package.name/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:3790)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3830)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3038)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6944)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
     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:1361)
        at android.app.Activity.performResume(Activity.java:7415)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3765)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3830) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3038) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6944) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)

The problem occurs only when I run the app from my Android phone, after installing the APK via adb install app-release.apk. The APK is signed with a keystore (I registered its SHA-1 on Firebase) and the release variant.

Note:

When I launch the app via the Run command on Android Studio everything goes fine.

binarybehemoth commented 3 years ago

I encountered a similar problem. Did you manage to solve the problem?

ilbertt commented 3 years ago

Unfortunately not, but maybe @chemerisuk could manage to solve it

ilbertt commented 3 years ago

Now it seems to run correctly also with release signing variant.