FB.INIT is failing while building for iOS.

Hello when I call FB.INIT in editor it works fine, but when I build for iOS I get:

FileNotFoundException: Could not load file or assembly ‘Facebook.Unity.IOS’ or one of its dependencies. The system cannot find the file specified.
at System.AppDomain.InternalSetContext (System.Runtime.Remoting.Contexts.Context context) [0x00000] in :0
at System.AppDomain.Load (System.String assemblyString) [0x00000] in :0
at Facebook.Unity.Mobile.IOS.IOSFacebook.GetIOSWrapper () [0x00000] in :0
at Facebook.Unity.Mobile.IOS.IOSFacebook…ctor () [0x00000] in :0
at Facebook.Unity.Mobile.IOS.IOSFacebookLoader.get_FBGameObject () [0x00000] in :0
at Facebook.Unity.FB+CompiledFacebookLoader.Start () [0x00000] in :0

I am using Facebook.Unity; as well. I have reimported the facebook sdk many times, so not sure why it isn’t working, thanks!

Few things I did and finally got it to work.

  1. Search for Facebook.Unity.IOS in the unity editor and make sure IOS is selected for this file in the inspector.

  2. Remove using Facebook.unity and put the whole function name when calling FB.init and anything that requires the header: ex. Facebook.Unity.FB.init();

  3. Add using Facebook.Unity.Mobile;

For anyone who’s intrested, we had a similar issue with Facebook SDK 7.11.1 and Unity 2017.3.1p4. It seems that the SDK requires to be in the root Assets folder since it copies some files to the XCode project with AssetPostProcessor.