当试图在横向模式Facebook的统一SDK v5.0.3崩溃登陆 - 机器人 [英] Facebook Unity Sdk v5.0.3 crashes in Landscape mode when trying to login - Android

查看:391
本文介绍了当试图在横向模式Facebook的统一SDK v5.0.3崩溃登陆 - 机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

游戏崩溃,当我点击登录时按钮的游戏在横向模式。如果我使用肖像模式,一切工作正常,正常。

The game crashes when I click at login button as the game is in landscape mode. If I use portrait mode, everything works fine and correctly.

我从bugsense以下堆栈跟踪,当我崩溃。

I got the following stack trace from bugsense when I got the crash.

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.adssdk.plugins/com.facebook.unity.FBUnityLoginActivity}: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that has a pending request.
1at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2205)
2at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2240)
3at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3809)
4at android.app.ActivityThread.access$700(ActivityThread.java:139)
5at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1266)
6at android.os.Handler.dispatchMessage(Handler.java:99)
7at android.os.Looper.loop(Looper.java:156)
8at android.app.ActivityThread.main(ActivityThread.java:4987)
9at java.lang.reflect.Method.invokeNative(Native Method)
10at java.lang.reflect.Method.invoke(Method.java:511)
11at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
13at dalvik.system.NativeStart.main(Native Method)
14Caused by: java.lang.UnsupportedOperationException: Session: an attempt was made to request new permissions for a session that has a pending request.
15at com.facebook.Session.requestNewPermissions(Session.java:1006)
16at com.facebook.Session.requestNewPublishPermissions(Session.java:512)
17at com.facebook.unity.FB.initAndLogin(FB.java:200)
18at com.facebook.unity.FB.LoginUsingActivity(FB.java:249)
19at com.facebook.unity.FBUnityLoginActivity.onCreate(FBUnityLoginActivity.java:13)
20at android.app.Activity.performCreate(Activity.java:4538)
21at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1071)
22at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)

如果有人对你已经实现了这个在横向模式下,并没有得到一个崩溃,登录,不要让我知道。

If anyone of you has implemented this in landscape mode and is not getting a crash while logging in, do let me know.

推荐答案

是的,这是一个错误,我们正在正确的修复现在。 同时,你可以编辑你的Andr​​oid清单中的插件/ Android和添加的安卓configChanges 的,这样的 FBUnityLoginActivity 的不被破坏时,方向/任何变化:

yes, this is a bug, we are working on proper fix right now. Meanwhile you can edit your android manifest in Plugins/Android and add android:configChanges so that FBUnityLoginActivity isn't destroyed when orientation/whatever changes:

<activity 
  android:name="com.facebook.unity.FBUnityLoginActivity" 
  android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
  android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>

您可能还需要从活动Style删除半透明。

you may also want to remove "Translucent" from activity style.

这篇关于当试图在横向模式Facebook的统一SDK v5.0.3崩溃登陆 - 机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆