在Android上使用Facebook模块时出现java.lang.NullPointerException

时间:2015-07-20 11:43:37

标签: facebook-android-sdk trigger.io

将最新的Facebook(v2.12)模块与Trigger.io(平台v2.2.14)一起使用,尝试“使用Facebook登录”会导致应用程序崩溃并在日志中显示以下内容:

07-20 12:10:46.834: E/AndroidRuntime(7013): FATAL EXCEPTION: main
07-20 12:10:46.834: E/AndroidRuntime(7013): Process: com.myapp, PID: 7013
07-20 12:10:46.834: E/AndroidRuntime(7013): java.lang.RuntimeException: Unable to resume activity {com.myapp/com.facebook.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2986)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3017)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.access$800(ActivityThread.java:151)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.os.Handler.dispatchMessage(Handler.java:102)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.os.Looper.loop(Looper.java:135)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.main(ActivityThread.java:5254)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at java.lang.reflect.Method.invoke(Native Method)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at java.lang.reflect.Method.invoke(Method.java:372)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
07-20 12:10:46.834: E/AndroidRuntime(7013): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.LoginActivity$2.onBackgroundProcessingStarted(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.notifyBackgroundProcessingStart(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.access$2(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient$GetTokenAuthHandler.tryAuthorize(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.tryCurrentHandler(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.tryNextHandler(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.authorize(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.AuthorizationClient.startOrContinueAuth(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at com.facebook.LoginActivity.onResume(Unknown Source)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1257)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.Activity.performResume(Activity.java:6076)
07-20 12:10:46.834: E/AndroidRuntime(7013):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2975)

我在Facebook上仔细检查了App ID,Key Hash和相关设置,但错误仍然存​​在。有没有人遇到过同样的问题,你是如何解决它的?

1 个答案:

答案 0 :(得分:1)

Trigger.io Facebook Module v2.13修复了Android上的登录问题。