在Facebook上分享帖子后游戏崩溃

时间:2015-07-29 16:25:14

标签: unity3d facebook-unity-sdk

我正在使用fb.feed在我的游戏中分享Facebook上的帖子。它成功发布到我的时间轴,但游戏崩溃了。这是日志所说的内容:

 07-28 18:47:19.859: E/AndroidRuntime(27621): FATAL EXCEPTION: main
 07-28 18:47:19.859: E/AndroidRuntime(27621): Process: 

com.blacksprite.pixelescape, PID: 27621
 07-28 18:47:19.859: E/AndroidRuntime(27621): java.lang.Error: FATAL EXCEPTION [main]

 07-28 18:47:19.859: E/AndroidRuntime(27621): Unity version     : 5.1.1f1
 07-28 18:47:19.859: E/AndroidRuntime(27621): Device model      : asus Nexus 7
 07-28 18:47:19.859: E/AndroidRuntime(27621): Device fingerprint: google/razor/flo:5.1.1/LMY48G/1965118:user/release-keys
 07-28 18:47:19.859: E/AndroidRuntime(27621): Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=64207, result=-1, data=Intent { (has extras) }} to activity {com.blacksprite.pixelescape/com.facebook.unity.FBUnityDialogsActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3574)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread.handleSendResult(ActivityThread.java:3617)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread.access$1300(ActivityThread.java:151)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1352)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.os.Handler.dispatchMessage(Handler.java:102)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.os.Looper.loop(Looper.java:135)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread.main(ActivityThread.java:5254)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at java.lang.reflect.Method.invoke(Native Method)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at java.lang.reflect.Method.invoke(Method.java:372)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
 07-28 18:47:19.859: E/AndroidRuntime(27621): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.lang.String.equals(java.lang.Object)' on a null object reference
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.facebook.unity.FBUnityDialogsActivity$1.onComplete(FBUnityDialogsActivity.java:93)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.facebook.widget.FacebookDialog.handleActivityResult(FacebookDialog.java:372)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.facebook.UiLifecycleHelper.handleFacebookDialogActivityResult(UiLifecycleHelper.java:301)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.facebook.UiLifecycleHelper.onActivityResult(UiLifecycleHelper.java:165)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at com.facebook.unity.FBUnityDialogsActivity.onActivityResult(FBUnityDialogsActivity.java:77)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.Activity.dispatchActivityResult(Activity.java:6192)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     at android.app.ActivityThread.deliverResults(ActivityThread.java:3570)
 07-28 18:47:19.859: E/AndroidRuntime(27621):     ... 10 more

1 个答案:

答案 0 :(得分:1)

尝试将facebook unity SDK更新为测试版,然后尝试他们的示例。如果示例工作正常,那么实现中存在问题。

https://developers.facebook.com/docs/unity/downloads