Unity iOS project 'FBSDKShareKit/FBSDKShareKit.h' file not found

I use Unity 2019.3.0f3 for export Unity to iOS as Framework. And when I open exported iOS project I get the issue

but I can navigate to this header use “Cmd+click”.
I googled and tried almost all solutions which I could find I tried set home directory for Framework Search Path to ‘$(HOME)/Documents/FacebookSDK’ also tried set FBSDKShareKit.Framework as embeddedFramework and install Pods. Nothing helped.

How can I figure out it?

1 Like

Have you managed to find out any solution? Facing this issue here as well.

I downgraded FacebookSDK to 7.16.1

1 Like

Thanks!! That did the trick!

This issue appears to be first related to not having podfile generation turned on in play services resolver. You can find that here: Assets/Play Services Resolver/iOS Resolver/Settings

Once I turned that on, I got stuck at a different issue though that appears to not have been fixed by facebook yet:
https://github.com/facebook/facebook-sdk-for-unity/issues/350

I used a workaround suggested here:
https://github.com/facebook/facebook-ios-sdk/issues/1102

Changing the FacebookSDK/Plugins/Editor/Dependencies.xml to use an earlier version of the Facebook SDK worked:

<iosPods>
<iosPod name="FBSDKCoreKit" version="5.8.0" />
<iosPod name="FBSDKLoginKit" version="5.8.0" />
<iosPod name="FBSDKShareKit" version="5.8.0" />
</iosPods>
2 Likes

This didnt work for me, using Facebook sdk 7.18-2.1 and Unity 2019.2.21

EDIT. It did work finally, I don’t know what I was doing wrong.

Still this is quite strange, the Facebook GitHub issues are closed but this still need to be fixed manually by changing the dependencies file. At least from Unity, and I’m using the last Facebook sdk 7.18-2.1 launched in February which change log says this problem is fixed.

1 Like

Checking Podfile Generation seems to be the correct fix.
I have also posted it here in related github issue

Im recently getting again the exception in Unity console after build:
FileNotFoundException: Could not find file “…/Libraries/RegisterMonoModules.h”
My dependencies are still the same, not sure why this happens but it lets me build successfully.

Hi,

I’m having the FBShareKit problem with Unity 2019.4.13 and Facebook SDK 8.1.1.
Anyone can help to resolve this?

1 Like

I can confirm that enabling Podfile generation in the iOS resolver cured the problem for us

1 Like

Guys,

Downgrading facebook sdk version is just a temporary solution, the root cause of this error is corrupt installation of cocoapods.

Even if unity says that cocoapods is installed it doesn’t always mean that it’s installed for real. To make sure, open your terminal and type ‘pod’ then hit enter, if it says that command not found then your cocoapods installation is broken. To fix this, run this command in terminal ‘sudo gem install cocoapods’.

Even after fixing cocoapods installation, facebook error may persist. Then try deleting unity generated xcode project, and build it again.

2 Likes

Facebook SDK 8.1.1 does not work with Unity 2019.4.16f1. (including podfile generation)
Downgrade to SDK 8.1.0 solve the issue.

Hi,
I’m using Unity 2019.4.9f1, Facebook SDK 8.1.0, podfile generation enabled
FBSDKShareKit problem still appear

When I change Dependecies.xml to become like this

<iosPods>
<iosPod name="FBSDKCoreKit" version="5.8.0" />
<iosPod name="FBSDKLoginKit" version="5.8.0" />
<iosPod name="FBSDKShareKit" version="5.8.0" />
</iosPods>

FBSDKShareKit problem disappear, but another error appear, which is FBSDKCoreKit/FBSDKCoreKit.h file not found

I already check pod from terminal at mac, and it run normally (I think)
It show $ pod command …

Is there any idea what should I do?

open command line in export folder that contain podfile.
Run command sudo pod repo update or pod update

See if it upgrade git repo in pod folder.
Then run pod install see if any errors show up.

There is an issue that cocopod failed to find newer FB version

If error say need newer cocopod version, then sudo upgrade gem and reinstall cocopod.
If that didn’t work out, upgrade xcode version again.

2 Likes

Thanks, NoDumbQuestion. That do the tricks

I have another question, do I have to run pod install everytime I update my unity project and build xcode for iOS?
Even though it using the same FBSDK version

Great job, Facebook! Another broken SDK that wastes a ton of developer time. Do they even QA this? And why doesn’t Unity do something about it?

Specifically, it’s been over 2 months since the Facebook SDK release and developers are left to figure out why their apps are insta-crashing. Should be an immediate patch-fix, right?

2 Likes

I tried this commands It’s work and know I can build. you need open your terminal and go to you XCode Folder then excite this commands lines. If it now work try repeat second time.

pod ‘FBSDKShareKit’
pod install

Try opening Xcode using the .xcworkspace file instead of .xcodeproj. And if you’re building it via Jenkins, make sure to pass the xcodeWorkspaceFile parameter.

5 Likes

I’m trying to add Facebook SDK 9.0, Unity 2019.3.9f1.

  • Podfile Generation selected,
  • can not use FB 5.8.0

and xcode gives me

‘FBSDKCoreKit_Basics/FBSDKBasicUtility.h’ file not found.

Anyone still facing this issue?

Also have this issue, Facebook SDK 9.0, Unity 2019.4.16f1

‘FBSDKShareKit/FBSDKShareKit.h’ file not found’