我有一个应用程序,可以在Firebase上存储数据并需要身份验证(谷歌)。登录似乎适用于其他设备,但是当我尝试从Nexus 7登录时,它只是失败了。
经过一些研究后我发现了一些建议,我尝试更新firebase应用设置,添加新的SHA并下载最新的google-services.json,但似乎没有任何效果。 以下是日志。
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=9001, result=0, data=null} to activity
{com.culminanttech.carmate/com.culminanttech.carmate.GoogleSignInActivity}:
java.lang.NullPointerException
at android.app.ActivityThread.deliverResults(ActivityThread.java:3351)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3394)
at android.app.ActivityThread.access$1300(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.culminanttech.carmate.GoogleSignInActivity.onActivityResult(GoogleSignInActivity.java:127)
at android.app.Activity.dispatchActivityResult(Activity.java:5423)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3347)... 11 more
java.lang.NullPointerException
at com.culminanttech.carmate.GoogleSignInActivity.onActivityResult(GoogleSignInActivity.java:127)
at android.app.Activity.dispatchActivityResult(Activity.java:5423)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3347)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3394)
at android.app.ActivityThread.access$1300(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
编辑:我也尝试了this示例,但我遇到了同样的崩溃。
第二次编辑:在某些设备上测试后,我意识到它似乎只适用于Lollipop及以上版本。想知道棒棒糖下面的问题是什么。是否必须对游戏服务做些什么?