- Home /
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!
Answer by czugalu · Aug 10, 2017 at 07:29 PM
Few things I did and finally got it to work.
Search for Facebook.Unity.IOS in the unity editor and make sure IOS is selected for this file in the inspector.
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();
Add using Facebook.Unity.Mobile;
Answer by FabioGaudenzi · Mar 28, 2018 at 08:33 AM
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.
Your answer
Follow this Question
Related Questions
Do our company need a Facebook business account for integrating our unity game? 1 Answer
Facebook Login to create User account in my App 0 Answers
unity facebook sdk error build in Xcode for iOS 0 Answers
Broadcast Facebook Post To All App Users 0 Answers
Firebase.analytics are not showing 2 Answers