facebook / facebook-sdk-for-unity

The facebook sdk for unity.
https://developers.facebook.com/docs/unity
Other
489 stars 256 forks source link

NullReferenceException #415

Open joakimkm opened 4 years ago

joakimkm commented 4 years ago

I have been following this official guide But I keep getting NullReferenceException when trying to login. Even after updating Unity to latest 2019.3.5. I am making a clean project from scratch.

NullReferenceException is happening after I run MainMenu example scene, pasting in User Access Token and pressing "Send success" inside "Mock Login Dialog".

The full error: _NullReferenceException: Object reference not set to an instance of an object Facebook.Unity.FB.get_FacebookDomain () (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.Constants.get_GraphUrl () (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.FacebookBase.GetGraphUrl (System.String query) (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.FacebookBase.API (System.String query, Facebook.Unity.HttpMethod method, System.Collections.Generic.IDictionary2[TKey,TValue] formData, Facebook.Unity.FacebookDelegate1[T] callback) (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.FB.API (System.String query, Facebook.Unity.HttpMethod method, Facebook.Unity.FacebookDelegate1[T] callback, System.Collections.Generic.IDictionary2[TKey,TValue] formData) (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.Editor.Dialogs.MockLoginDialog.SendSuccessResult () (at <13b9258c470846cf9f6bdf359c2df8eb>:0) Facebook.Unity.Editor.EditorFacebookMockDialog.OnGUIDialog (System.Int32 windowId) (at <13b9258c470846cf9f6bdf359c2df8eb>:0) UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at <1006e0a2a62b4fc092e72663bea815ca>:0)

AssemDeghady commented 4 years ago

+1 i had similar error when i updated to version 7.19.0 so i simply rolled back to the version i was using 7.18.1

joakimkm commented 4 years ago

I can confirm that 7.18.1 do not have this bad behaviour. Thank you very much @AssemDeghady !

bakalarczuk commented 4 years ago

So what is the reason to publish 7.19 version if it doesn't work with newest Unity????

pixeption commented 4 years ago

Not just the latest Unity, I get it in Unity 2017.4.33f1

brandesign commented 4 years ago

It is a problem only in the editor.

nephritic commented 4 years ago

Even if it's a problem within Unity Editor only.. should be fixed ;) p.s. same for me Unity 2019.3.5f1

emraankhalil commented 4 years ago

having same issue too. anybody has fixed that?

joakimkm commented 4 years ago

having same issue too. anybody has fixed that

Downgrade to 7.18.1 or use something other than Facebook with Unity. Facebook seems to ignore this report (Added this 14 days ago and nothing is happening) It feels unsafe to use something which is maintained in this way.

bakalarczuk commented 4 years ago

There is a 7.19.1

bakalarczuk commented 4 years ago

There is a 7.19.1