Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity and Facebook

Discussion in 'Editor & General Support' started by EdgarCarrera, Jun 21, 2014.

  1. EdgarCarrera

    EdgarCarrera

    Joined:
    Apr 21, 2014
    Posts:
    255
    Help me with this two errors please?


    Unable to verify assembly data; you must provide an authorization key when loading this assembly.
    UnityEngine.Security:LoadAndVerifyAssembly(Byte[])
    <LoadFacebookClass>c__Iterator1:MoveNext() (at Assets/Facebook/Scripts/FB.cs:358)


    Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_5.0/CanvasFacebook.dll
    UnityEngine.Debug:LogError(Object)
    FbDebug:Error(String)
    <LoadFacebookClass>c__Iterator1:MoveNext() (at Assets/Facebook/Scripts/FB.cs:361)
     
  2. Ettore_Ink

    Ettore_Ink

    Joined:
    Mar 4, 2014
    Posts:
    3
    same error
     
  3. kaushik-d

    kaushik-d

    Joined:
    Aug 25, 2011
    Posts:
    19
    The latest version of the Facebook SDK (5.1) on the facebook dev website (not the one from AssetStore) fixes this problem.
     
  4. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I have this problem with Unity 4.5.1 and Facebook SDK 5.1.

    I tried the solution at http://stackoverflow.com/questions/...-must-provide-an-authorization-key-when-loadi

    Code (CSharp):
    1. string key =    "B8GvecdX0rQ47kzhCEwlrRzYKA8LKeiZxy1HI3HfnhdgUATvBwQQViji8ot44dADM55QuHk5+hwrLso" +
    2.                         "au32IDmRDQTclMSsTsIywGRo/nE5vbmRMMIECYXBFhliz+kvK0RWZ57XPxw0s7YhGnNLav0EE2QH/m+9a" +
    3.                         "jlLOY+2ckxSoSEHLpotllyZLktRK+oFiDPvmzXLDUMOnwK9RFRSh2VBmoyWTZx8BYqWjqug3kAljJk/Xw" +
    4.                         "TYZT9Ie+HvzLO5DBSqMNYbEX03WaNfpaq9GKBF/Oz37AHelf1Es36amP1v2Aut3nmIk2xxN6zwzBXyEyw" +
    5.  
    6. "90vJ/O8suikU+8kDDbZA==";
    7.  
    8. var assembly = Security.LoadAndVerifyAssembly(www.bytes, key);
    But I get a FormatException: Invalid length. when running.

    Ok, I noticed an rogue invisible character at the start of the 4th line. That fixed the exception but I still cannot securely load the assembly.

    Could not securely load assembly from https://integrated-plugin-canvas-rsrc.fbsbx.com/rsrc/unity/lib/sdk_5.1/CanvasFacebook.dll

    UPDATE:

    As of Monday 30 June the original issue seems to have been resolved. There's now no problem loading the assembly via the original code.

    UPDATE 2:

    I'm still seeing the secure load fail some of the time.
     
    Last edited: Jul 1, 2014
  5. Unity Ninja

    Unity Ninja

    Joined:
    Jun 14, 2014
    Posts:
    14
    Hey, where has the issue been resolved ? How did you solve it? I'm still getting that error and I am just stuck!! Halp!
     
  6. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    I reverted to Unity 4.3.4 so I don't know the status of the issue at the moment.
     
  7. Unity Ninja

    Unity Ninja

    Joined:
    Jun 14, 2014
    Posts:
    14
    Alright so it works with the 4.3 version right? I think I'll have to revert too. Pretty strange they are not fixing the fb sdk for unity4.5
     
  8. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    Yes, I don't have any problems under Unity 4.3.4. Although the reason I reverted back from 4.5 was for other issues that affected another project.

    The most recent version on the Facebook SDK for Unity download page is 5.1 which is almost 4 months old now which is a really long time compared to the other versions.

    I also don't like fact that we have to use stackoverflow to report issues/ask for help as you are restricted if you're a new user on there. Surely a thread on the Unity Forums would be more appropriate.
     
  9. Unity Ninja

    Unity Ninja

    Joined:
    Jun 14, 2014
    Posts:
    14
    Yeah, stackoverflow is limiting, but we are talking on unity forums right now right? lol
    Ok and I did figure out a fix without downgrading to unity 4.3
    Thing is, the facebook sdk on the asset store is still an old version but if go to the facebook developers website, there they have a newer version that works just fine. And it sucks that they didn't update it in the asset store! Who would have known...
     
  10. andymads

    andymads

    Joined:
    Jun 16, 2011
    Posts:
    1,614
    As I said the most recent version is 5.1 here. Unless you have found another page on the Facebook Developers site with a newer version?

    I don't download it from the Asset Store.
     
  11. Unity Ninja

    Unity Ninja

    Joined:
    Jun 14, 2014
    Posts:
    14
    Nope its the same one. Wish I knew not to download from asset store! I broke my head for 2 days because of it.