Search Unity

Facebook.Unity.IOS FileNotFoundException

Discussion in 'iOS and tvOS' started by jmakar, Oct 18, 2018.

  1. jmakar

    jmakar

    Joined:
    Jun 27, 2018
    Posts:
    18
    Hi - I've integrated the Facebook SDK (7.12.2) with my Unity project (2018.2.8f1). Everything works well in the editor and on Android. When testing on iOS, after an FB.Init() attempt I receive the following error:
    FileNotFoundException: Could not load file or assembly 'Facebook.Unity.IOS' or one of its dependencies. The system cannot find the file specified.
    • My iOS portions of the SDK are indeed marked to be included for iOS in the inspector.
    • The SDK exists at this location: Assets/Plugins/FacebookSDK
      • Note: This makes the Facebook.Unity DLL exist here: Assets/Plugins/FacebookSDK/Plugins/iOS/Facebook.Unity.IOS
    I could really use some advice here. I've found a couple of other people reporting this issue which is generally solved by things I've already done. Such as this.

    Thanks for any info.

    ps - we do have some non-FB DLLs in other folders outside of this Plugins folder. Such as JSON.net. That JSON DLL is being used as I can tell from the logs. Is it possible that once Unity detects a lib from one location it will only look for future libs from that same location?
     
    Last edited: Oct 18, 2018
  2. jmakar

    jmakar

    Joined:
    Jun 27, 2018
    Posts:
    18
    SOLVED.

    The Facebook SDK includes link.xml which indicates managed code that needs to be included and not stripped out. For some reason link.xml was not included in my project. Once added everything behaved.
     
    benbenmushi likes this.
  3. Qurious_Media

    Qurious_Media

    Joined:
    Jan 7, 2017
    Posts:
    4
    .............

    Hi @jmakar , may i know how could i get link.xml file and how to add link.xml and at which location.....?

    Thanks
     
  4. jmakar

    jmakar

    Joined:
    Jun 27, 2018
    Posts:
    18
    1.) Get the Unity SDK version that you want from here: https://developers.facebook.com/docs/unity/downloads/
    2.) Install it by double clicking the .unitypackage (after unzipping of course)

    The installer should place the SDK here: Assets/FacebookSDK

    The link.xml file will automatically be placed at this location: Assets/FacebookSDK/link.xml. You don't need to do it yourself. Somehow in my case it was just missing.