在Firebase-Unity Auth中更新电话号码时,应用程序崩溃

时间:2018-07-07 04:12:49

标签: firebase unity3d firebase-authentication

我正在实现一种方法来更改用户的登录电话号码。为此,首先我打电话给PhoneAuthProvider.VerifyPhoneNumber以获取带有代码的SMS。然后,我使用代码通过PhoneAuthProvider.GetCredential获取证书。到目前为止,一切正常。当我致电FirebaseUser.UpdatePhoneNumberCredentialAsync最终更新手机时,该应用程序崩溃了。该数字实际上在Firebase中正在更新,但是该方法在完成之前崩溃。我是在做错什么,还是Firebase-Unity错误?遵循Logcat的错误日志。

(Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
07-06 21:01:03.776 2375-2412/? W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod() returned Gms: com.google.android.gms.internal.zzdze@7af1ff3
07-06 21:01:05.597 2375-2536/? D/FirebaseAuth: Notifying id token listeners about user ( fVZUcEX80zWZIzD5xU8cIhSloVi1 ).
07-06 21:01:05.597 2375-2375/? D/FirebaseApp: Notifying auth state listeners.
07-06 21:01:05.598 2375-2375/? D/FirebaseApp: Notified 0 auth state listeners.
07-06 21:01:05.599 2375-2375/? E/firebase: result != nullptr
07-06 21:01:05.610 20205-30810/? W/FirebaseAuth: [PhoneNumberAuthPostProcessor] postProcess starts
07-06 21:01:05.693 2375-2375/? A/zygote: java_vm_ext.cc:504] JNI DETECTED ERROR IN APPLICATION: can't call com.google.firebase.auth.FirebaseUser com.google.firebase.auth.AuthResult.getUser() on null object
    java_vm_ext.cc:504]     in call to CallObjectMethodV
    java_vm_ext.cc:504]     from void com.google.firebase.app.internal.cpp.JniResultCallback.nativeOnResult(java.lang.Object, boolean, int, java.lang.String, long, long)
    java_vm_ext.cc:504] "main" prio=5 tid=1 Runnable
    java_vm_ext.cc:504]   | group="main" sCount=0 dsCount=0 flags=0 obj=0x736004d8 self=0xe85f5000
    java_vm_ext.cc:504]   | sysTid=2375 nice=-10 cgrp=default sched=0/0 handle=0xecbba4bc
07-06 21:01:05.694 2375-2375/? A/zygote: java_vm_ext.cc:504]   | state=R schedstat=( 6746232415 788335286 4198 ) utm=547 stm=126 core=7 HZ=100
    java_vm_ext.cc:504]   | stack=0xff162000-0xff164000 stackSize=8MB
    java_vm_ext.cc:504]   | held mutexes= "mutator lock"(shared held)
    java_vm_ext.cc:504]   native: #00 pc 002c4a4b  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+130)
    java_vm_ext.cc:504]   native: #01 pc 003560a1  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+200)
    java_vm_ext.cc:504]   native: #02 pc 00352573  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+34)
    java_vm_ext.cc:504]   native: #03 pc 0022ff35  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+736)
    java_vm_ext.cc:504]   native: #04 pc 0023032b  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
    java_vm_ext.cc:504]   native: #05 pc 000d280b  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
    java_vm_ext.cc:504]   native: #06 pc 000d56a9  /system/lib/libart.so (_ZN3art11ScopedCheck17CheckMethodAndSigERNS_18ScopedObjectAccessEP8_jobjectP7_jclassP10_jmethodIDNS_9Primitive4TypeENS_10InvokeTypeE+1228)
    java_vm_ext.cc:504]   native: #07 pc 000d4427  /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+514)
    java_vm_ext.cc:504]   native: #08 pc 000c548b  /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+38)
    java_vm_ext.cc:504]   native: #09 pc 000b0513  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18)
    java_vm_ext.cc:504]   native: #10 pc 000c5d6b  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth16ReadSignInResultEP8_jobjectPNS0_18FutureCallbackDataEbPv+46)
    java_vm_ext.cc:504]   native: #11 pc 000c5cad  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth14FutureCallbackEP7_JNIEnvP8_jobjectbiPKcPv+120)
    java_vm_ext.cc:504]   native: #12 pc 000cf0fd  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4util32JniResultCallback_nativeOnResultEP7_JNIEnvP8_jobjectS4_hiP8_jstringxx+116)
    java_vm_ext.cc:504]   native: #13 pc 000002c5  /data/data/com.company.product/cache/oat/arm/app_resources_lib.odex (Java_com_google_firebase_app_internal_cpp_JniResultCallback_nativeOnResult__Ljava_lang_Object_2ZILjava_lang_String_2JJ+164)
    java_vm_ext.cc:504]   at com.google.firebase.app.internal.cpp.JniResultCallback.nativeOnResult(Native method)
    java_vm_ext.cc:504]   at com.google.firebase.app.internal.cpp.JniResultCallback.onCompletion(JniResultCallback.java:196)
    java_vm_ext.cc:504]   - locked <0x071a32e1> (a com.google.firebase.app.internal.cpp.JniResultCallback)
    java_vm_ext.cc:504]   at com.google.firebase.app.internal.cpp.JniResultCallback$TaskCallback.onSuccess(JniResultCallback.java:106)
    java_vm_ext.cc:504]   - locked <0x0cae6806> (a java.lang.Object)
    java_vm_ext.cc:504]   at com.google.android.gms.tasks.zzj.run(unavailable:-1)
    java_vm_ext.cc:504]   - locked <0x04984ec7> (a java.lang.Object)
    java_vm_ext.cc:504]   at android.os.Handler.handleCallback(Handler.java:789)
    java_vm_ext.cc:504]   at android.os.Handler.dispatchMessage(Handler.java:98)
    java_vm_ext.cc:504]   at android.os.Looper.loop(Looper.java:164)
    java_vm_ext.cc:504]   at android.app.ActivityThread.main(ActivityThread.java:6938)
    java_vm_ext.cc:504]   at java.lang.reflect.Method.invoke(Native method)
    java_vm_ext.cc:504]   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    java_vm_ext.cc:504]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
    java_vm_ext.cc:504] 
    runtime.cc:516] Runtime aborting...
    runtime.cc:516] 
    runtime.cc:524] JNI DETECTED ERROR IN APPLICATION: can't call com.google.firebase.auth.FirebaseUser com.google.firebase.auth.AuthResult.getUser() on null object
    runtime.cc:524]     in call to CallObjectMethodV
    runtime.cc:524]     from void com.google.firebase.app.internal.cpp.JniResultCallback.nativeOnResult(java.lang.Object, boolean, int, java.lang.String, long, long)
    runtime.cc:524] "main" prio=5 tid=1 Runnable
    runtime.cc:524]   | group="main" sCount=0 dsCount=0 flags=0 obj=0x736004d8 self=0xe85f5000
    runtime.cc:524]   | sysTid=2375 nice=-10 cgrp=default sched=0/0 handle=0xecbba4bc
    runtime.cc:524]   | state=R schedstat=( 6746232415 788335286 4198 ) utm=547 stm=126 core=7 HZ=100
    runtime.cc:524]   | stack=0xff162000-0xff164000 stackSize=8MB
    runtime.cc:524]   | held mutexes= "mutator lock"(shared held)
    runtime.cc:524]   native: #00 pc 002c4a4b  /system/lib/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+130)
    runtime.cc:524]   native: #01 pc 003560a1  /system/lib/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+200)
    runtime.cc:524]   native: #02 pc 00352573  /system/lib/libart.so (_ZNK3art6Thread4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMapb+34)
    runtime.cc:524]   native: #03 pc 0022ff35  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+736)
    runtime.cc:524]   native: #04 pc 0023032b  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
    runtime.cc:524]   native: #05 pc 000d280b  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
    runtime.cc:524]   native: #06 pc 000d56a9  /system/lib/libart.so (_ZN3art11ScopedCheck17CheckMethodAndSigERNS_18ScopedObjectAccessEP8_jobjectP7_jclassP10_jmethodIDNS_9Primitive4TypeENS_10InvokeTypeE+1228)
    runtime.cc:524]   native: #07 pc 000d4427  /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+514)
    runtime.cc:524]   native: #08 pc 000c548b  /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+38)
    runtime.cc:524]   native: #09 pc 000b0513  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18)
    runtime.cc:524]   native: #10 pc 000c5d6b  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth16ReadSignInResultEP8_jobjectPNS0_18FutureCallbackDataEbPv+46)
    runtime.cc:524]   native: #11 pc 000c5cad  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth14FutureCallbackEP7_JNIEnvP8_jobjectbiPKcPv+120)
07-06 21:01:05.695 2375-2375/? A/zygote: runtime.cc:524]   native: #12 pc 000cf0fd  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4util32JniResultCallback_nativeOnResultEP7_JNIEnvP8_jobjectS4_hiP8_jstringxx+116)
    runtime.cc:524]   native: #13 pc 000002c5  /data/data/com.company.product/cache/oat/arm/app_resources_lib.odex (Java_com_google_firebase_app_internal_cpp_JniResultCallback_nativeOnResult__Ljava_lang_Object_2ZILjava_lang_String_2JJ+164)
    runtime.cc:524]   at com.google.firebase.app.internal.cpp.JniResultCallback.nativeOnResult(Native method)
    runtime.cc:524]   at com.google.firebase.app.internal.cpp.JniResultCallback.onCompletion(JniResultCallback.java:196)
    runtime.cc:524]   - locked <0x071a32e1> (a com.google.firebase.app.internal.cpp.JniResultCallback)
    runtime.cc:524]   at com.google.firebase.app.internal.cpp.JniResultCallback$TaskCallback.onSuccess(JniResultCallback.java:106)
    runtime.cc:524]   - locked <0x0cae6806> (a java.lang.Object)
    runtime.cc:524]   at com.google.android.gms.tasks.zzj.run(unavailable:-1)
    runtime.cc:524]   - locked <0x04984ec7> (a java.lang.Object)
    runtime.cc:524]   at android.os.Handler.handleCallback(Handler.java:789)
    runtime.cc:524]   at android.os.Handler.dispatchMessage(Handler.java:98)
    runtime.cc:524]   at android.os.Looper.loop(Looper.java:164)
    runtime.cc:524]   at android.app.ActivityThread.main(ActivityThread.java:6938)
    runtime.cc:524]   at java.lang.reflect.Method.invoke(Native method)
    runtime.cc:524]   at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
    runtime.cc:524]   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
    runtime.cc:524] 
07-06 21:01:05.846 2563-2563/? A/DEBUG: Abort message: 'java_vm_ext.cc:504] JNI DETECTED ERROR IN APPLICATION: can't call com.google.firebase.auth.FirebaseUser com.google.firebase.auth.AuthResult.getUser() on null object'
        r0 00000000  r1 00000947  r2 00000006  r3 00000008
        r4 00000947  r5 00000947  r6 ff95d790  r7 0000010c
        r8 0000000b  r9 ff95d7f1  sl 0000000a  fp ff95d7f0
        ip 00000000  sp ff95d780  lr e9f6e447  pc e9f9f508  cpsr 200d0010
07-06 21:01:05.856 2563-2563/? A/DEBUG:     #04 pc 003ef7ad  /system/lib/libart.so (_ZN7android4base10LogMessageD1Ev+456)
        #05 pc 00230143  /system/lib/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1262)
        #06 pc 0023032b  /system/lib/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+58)
        #07 pc 000d280b  /system/lib/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+46)
        #08 pc 000d56a9  /system/lib/libart.so (_ZN3art11ScopedCheck17CheckMethodAndSigERNS_18ScopedObjectAccessEP8_jobjectP7_jclassP10_jmethodIDNS_9Primitive4TypeENS_10InvokeTypeE+1228)
        #09 pc 000d4427  /system/lib/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+514)
        #10 pc 000c548b  /system/lib/libart.so (_ZN3art8CheckJNI17CallObjectMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+38)
        #11 pc 000b0513  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN7_JNIEnv16CallObjectMethodEP8_jobjectP10_jmethodIDz+18)
        #12 pc 000c5d6b  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth16ReadSignInResultEP8_jobjectPNS0_18FutureCallbackDataEbPv+46)
        #13 pc 000c5cad  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4auth14FutureCallbackEP7_JNIEnvP8_jobjectbiPKcPv+120)
        #14 pc 000cf0fd  /data/app/com.company.product-muqASgSszT-5GC-bGDgKRQ==/lib/arm/libApp-4.5.2.so (_ZN8firebase4util32JniResultCallback_nativeOnResultEP7_JNIEnvP8_jobjectS4_hiP8_jstringxx+116)
        #15 pc 000002c5  /data/data/com.company.product/cache/oat/arm/app_resources_lib.odex (offset 0x2000)
07-06 21:01:17.397 20205-21357/? E/FirebaseAuth: [VerifyPhoneNumberOperation] RemoteException when sending auto retrieval timeout response.
    android.os.DeadObjectException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:761)
        at car.c(:com.google.android.gms@12685025@12.6.85 (040408-197041431):1)
        at bebh.c(:com.google.android.gms@12685025@12.6.85 (040408-197041431):2)
        at bdyf.a(:com.google.android.gms@12685025@12.6.85 (040408-197041431):4)
        at bdyd.a(:com.google.android.gms@12685025@12.6.85 (040408-197041431):1)
        at bdyd.c(:com.google.android.gms@12685025@12.6.85 (040408-197041431):1)
        at bdyd.handleMessage(:com.google.android.gms@12685025@12.6.85 (040408-197041431):52)
        at oup.run(:com.google.android.gms@12685025@12.6.85 (040408-197041431):5)
        at ovb.run(:com.google.android.gms@12685025@12.6.85 (040408-197041431):27)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at pbc.run(Unknown Source:7)
        at java.lang.Thread.run(Thread.java:764)
07-06 21:01:17.398 20205-21357/? W/FirebaseAuth: [PhoneVerificationSession] PhoneVerificationSession terminated
07-06 21:01:17.420 20205-28403/? W/FirebaseAuth: [PhoneNumberAuthPostProcessor] postProcess ends
07-06 21:01:17.433 20205-30810/? W/FirebaseAuth: [PhoneNumberAuthPostProcessor] postProcess ends

我正在使用的方法:

public void UpdatePhoneNumber(string smsCode, Action<string> OnUpdatePhoneFinish)
{
    Debug.Log("CODE: " + smsCode);

    if (m_signupData != null)
    {
        m_signupData.Credetial = PhoneAuthProvider.GetInstance(m_firebaseAuth).GetCredential(m_signupData.Id, smsCode); 

        Debug.Log("CREDENTIAL: " + m_signupData.Credetial); // working fine until this point

        m_firebaseUser.UpdatePhoneNumberCredentialAsync(m_signupData.Credetial).ContinueWith((task) =>
        {
            Debug.Log("Finished request"); // never reaches this debug
        });
    }
}

一切正常,直到我打电话给UpdatePhoneNumberCredentialAsync。永远不会到达回调内部的Debug。

1 个答案:

答案 0 :(得分:0)

看起来这是一个Firebase-Unity错误,已在5.2.0版中修复:

Bug-fix release-note

https://firebase.google.com/support/release-notes/unity