- Home /
Errors after upgrading to Facebook SDK 7.3
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?
Same error unity unity 5.3.1on fb sdk 7.3.0. Anyone fixed it yet?
Same here... I'm new to facebook sdk, assumed it was my mistake, but apparently not...
Checked on the facebook developer issues, they have already fixed it, we just have to wait for the new version of SD$$anonymous$$
Answer by OwlCat · Jan 12, 2016 at 04:57 PM
if error in this place :
public EditorFacebookMockDialog()
{
this.modalRect = new Rect(10, 10, Screen.width - 20, Screen.height - 20);
Texture2D texture = new Texture2D(1, 1);
texture.SetPixel(0, 0, new Color(0.2f, 0.2f, 0.2f, 1.0f));
texture.Apply();
this.modalStyle = new GUIStyle(GUI.skin.window);
this.modalStyle.normal.background = texture;
}
do this :
this.modalStyle = new GUIStyle();
Next step - go to code with error :
You cannot show two modal windows at once UnityEngine.GUI:ModalWindow(Int32, Rect, WindowFunction, String, GUIStyle)
And change line with error from this "ModalWindow" to this "Window"
WorpeX, this is the Best Answer ever! you should accept this!:) Thank you very much OwlCat, you're hero:). $$anonymous$$y Login System has worked. I hope I wouldn't have other errors with sending scores, inviting friends etc.!][1]
Worked perfectly!! Thank you!! Facebook should hire you since they clearly can't test this properly own their own...
Dude you are awesome ! you just saved my day !! :')
@OwlCat where to find EditorFacebook$$anonymous$$ockDialog function?
I have the same error, but can't find Facebook.Unity.Editor.EditorFacebook$$anonymous$$ockDialog:OnGUI() I'm viewing in the Assembly Browser file by file , advanced search in whole solution ..etc I can't have any results finding EditorFacebook$$anonymous$$ockDialog:OnGUI()
$$anonymous$$aybe I need to add this function some place in Facebook.Unity.Editor .. any hints?
Your answer
![](https://koobas.hobune.stream/wayback/20220612055624im_/https://answers.unity.com/themes/thub/images/avi.jpg)