I’m getting strange errors after upgrading to Facebook SDK 7.3. This is happening when trying to connect to facebook. Here are the errors:
- ArgumentException: You can only call
GUI functions from inside OnGUI.
UnityEngine.GUIUtility.CheckOnGUI ()
(at
C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUIUtility.cs:202) - You cannot show two modal windows at
once
UnityEngine.GUI:ModalWindow(Int32,
Rect, WindowFunction, String,
GUIStyle) - ArgumentException: Getting control
0’s position in a group with only 0
controls when doing Repaint Aborting
UnityEngine.GUILayoutGroup.GetNext ()
(at
C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:637) - NullReferenceException: Object
reference not set to an instance of
an object
UnityEngine.GUILayoutEntry.ApplyStyleSettings
(UnityEngine.GUIStyle style) (at
C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:488)
Wasn’t having these errors while in SDK 7.2.2. I was having another issue previously, which is why I wanted to update. That issue was a crash while trying to connect that happened on an Android device (not in unity) which it sounded like this update fixed. Here is my code:
public void FBlogin()
{
string[] perms = new string[10];
perms [0] = "email";
perms [1] = "user_friends";
perms [2] = "publish_actions";
FB.LogInWithReadPermissions(perms, AuthCallback);
}
void AuthCallback(IResult result)
{
if(FB.IsLoggedIn)
{
Debug.Log ("FB login worked!");
DealWithFBMenus(true);
}else
{
Debug.Log ("FB login fail!");
DealWithFBMenus(false);
}
}
Don’t believe the script is getting passed these 2 methods. The Debug.Log’s are not being displayed in the Console. The Facebook Login GUI does not load.
Any ideas?