After updating to Unity 4.6 the Facebook SDK is not working anymore due to assembly authorization errors, see below. Does anybody know how to get this running again?
Unable to verify assembly data; you must provide an authorization key when loading this assembly.
UnityEngine.Security:LoadAndVerifyAssembly(Byte[])
<LoadFacebookClass>c__Iterator12:MoveNext() (at Assets/Facebook/Scripts/FB.cs:422)
Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_6.0/CanvasFacebook.dll
UnityEngine.Debug:LogError(Object)
FbDebug:Error(String)
<LoadFacebookClass>c__Iterator12:MoveNext() (at Assets/Facebook/Scripts/FB.cs:426)
Its a pretty easy fix. The Facebook SDK runs a check to see if its in Unity 4.5, as 4.5 introduced new security features for loading assemblies. If you remove the pre-processor directive for compiling in 4.5 then it works fine. I suppose you could also change it to #if Unity_4_6. But that will break again next time you upgrade.
Edit: Tried to post the solution here but haven’t yet got the hang of formatting code on the forums. Link goes to a nice looking UA solution.
Thanks man it worked for me… Althoughhhhh it works on my comp now but once uploaded to my phone nothing happens when i click the FB button i don’t get why it works on my comp but not on my android device!! Arrrr please help
would it happen to have something with this notice…
Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices.
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
If you are not going to go back to older versions with the project its better to just remove the pre-processor code. Entirely delete the code for the older version, and remove the pre-processor directives around the new code. That way you don’t need to keep making changes every time there is a point update.