使用以下代码显示Facebook共享对话框时,Facebook崩溃。
FacebookDialog.ShareDialogBuilder builder =
new FacebookDialog.ShareDialogBuilder(activity);
FacebookDialog shareDialog = builder.build();
return shareDialog.present();
这是返回的堆栈跟踪:
04-29 15:47:52.929 32647-32647/? E/ACRA﹕ ACRA caught a StackOverflowError exception for com.facebook.katana. Building report.
04-29 15:47:52.934 2214-2214/? E/display﹕ invalid gralloc handle (at 0x0)
04-29 15:47:52.944 32647-32647/? E/fb4a(:<default>):ACRA﹕ Handling exception for crash
java.lang.StackOverflowError
at android.os.Parcel.writeInt(Parcel.java:484)
at android.os.Parcel.writeArrayMapInternal(Parcel.java:608)
at android.os.Bundle.writeToParcel(Bundle.java:1692)
at android.os.Parcel.writeBundle(Parcel.java:636)
at android.os.Parcel.writeValue(Parcel.java:1201)
...
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ java.lang.StackOverflowError
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeInt(Parcel.java:484)
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeArrayMapInternal(Parcel.java:608)
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Bundle.writeToParcel(Bundle.java:1692)
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeBundle(Parcel.java:636)
04-29 15:47:54.609 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeValue(Parcel.java:1201)
...
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeArrayMapInternal(Parcel.java:618)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Bundle.writeToParcel(Bundle.java:1692)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Parcel.writeBundle(Parcel.java:636)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.content.Intent.writeToParcel(Intent.java:7414)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityManagerProxy.finishActivity(ActivityManagerNative.java:2480)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.Activity.finish(Activity.java:4303)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.base.activity.FbFragmentActivity.finish(FbFragmentActivity.java:313)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.platform.common.activity.PlatformWrapperActivity.a(PlatformWrapperActivity.java:489)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.platform.common.activity.PlatformWrapperActivity.e(PlatformWrapperActivity.java:401)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.platform.common.activity.PlatformWrapperActivity.c(PlatformWrapperActivity.java:374)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.platform.common.activity.PlatformWrapperActivity.a(PlatformWrapperActivity.java:269)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.facebook.base.activity.FbFragmentActivity.onCreate(FbFragmentActivity.java:171)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.Activity.performCreate(Activity.java:5428)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2271)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2365)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityThread.access$800(ActivityThread.java:164)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1258)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Handler.dispatchMessage(Handler.java:102)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.os.Looper.loop(Looper.java:157)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at android.app.ActivityThread.main(ActivityThread.java:5350)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at java.lang.reflect.Method.invokeNative(Native Method)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at java.lang.reflect.Method.invoke(Method.java:515)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ at dalvik.system.NativeStart.main(Native Method)
04-29 15:47:54.624 32647-32647/? E/CatchMeIfYouCan﹕ Process (<default>) is exiting...
FbFragmentActivity.finish
似乎导致堆栈溢出尝试创建一个parcel,但我无法确定是什么导致该进程进入无限循环。到目前为止,这只能在三星设备上复制。
编辑: 从代码段中删除了调试代码。