Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode always says ‘FBSDKShareKit/FBSDKShareKit’.h file not found

Tags:

xcode

ios

unity3d

No matter what I do (I may be doing it wrong) When I try to build my unity IOS app for testing, Xcode always says ‘FBSDKShareKit/FBSDKShareKit’.h file not found.

I’ve added the Facebook SDK indicated in the Quick Start for iOS in the Xcode Project. From the Facebook SDK folder, dragged the folder FBSDKCoreKit.Framework, FBSDKLoginKit.Framework, FBSDKShareKit.Framework into your Xcode Projects Framework folder. Then configured info.plist as stated and of course supplied the bundle identifier. And it gives the same problem. Honestly I have spent more than 6 weeks on this single issue. I’m in the verge of mental and physical collapse and close to be fired. Please give some kind of advice. I’ve tried all the other answers in this same page but non work. Please help!!

like image 272
Ivan Avatar asked Feb 24 '16 00:02

Ivan


8 Answers

If you haven't installed cocoapods first:

sudo gem install cocoapods

then go to your Xcode project directory and do

pod install

it should create a .xcworkspace open it and build your project. You will have no problem.

The .xcworkspace must be created by cocoa pods not Unity. Sometimes unity creates it so it's missing Pods that's why Xcode can't find some libraries.

like image 161
Kureyş Alp Kılıç Avatar answered Nov 16 '22 23:11

Kureyş Alp Kılıç


I had this problem with XCode 10!!! Sorted in this way:

  • Select Libraries > RCTFBSDK.xcodeproj
  • Select Build Settings > Framework Search Paths
  • Replace the ~/Documents/FacebookSDK to $(HOME)/Documents/FacebookSDK (with parentheses!)

Believe it or not, now it works!

like image 23
Stefano Cremona Avatar answered Nov 17 '22 00:11

Stefano Cremona


If you're here because you're trying to use facebook/react-native-fbsdk, then you only need to add the following line to your Podfile:

pod 'FBSDKShareKit'

Then

pod install

Build and run!

like image 28
Lolloz89 Avatar answered Nov 16 '22 22:11

Lolloz89


I got the same issue and solve problem.<> My solution : 1. follow the steps from https://developers.facebook.com/docs/react-native/getting-started-ios 2. check the xcode proj -> Library, find and open file RCTFBSDK.xcodeproj then update fb sdk path in build setting->Framework search path.

It works. I guess that sometime the RCTFBSDK.xcodeproj in Library can not update the framework search path from main xcodeproj so we need done manually. Hopefully my solution can help you, Thanks.

like image 38
Jack Diff Avatar answered Nov 16 '22 23:11

Jack Diff


Drekka I was finally out of the game, until I read this answer and it gave my an Idea to try something different. This is what finally worked for me: The Framework Search Path was set wrong I it was such I tiny detail I wuold never noticed it if I was wasn't obsessed about it: In target - build settings - search paths - frameworks search paths change from:

$(inherited) $(PROJECT_DIR)/Frameworks\Plugins/iOS/Facebook (look at the wrong direction of the first slash)

to

$(SCROOT) $(inherited) $(PROJECT_DIR)/Frameworks/Plugins/iOS/Facebook

This is finally it I can go to sleep now!Thanks drekka!

like image 22
Ivan Avatar answered Nov 16 '22 23:11

Ivan


If you think you've done everything right but it still is not working, then make sure the FB [LoginKit, ShareKit, and CoreKit] are in your "Copy Bundle Resources".

enter image description here

This took me hours to figure out, hope it can help others!

like image 31
Luke Brandon Farrell Avatar answered Nov 16 '22 22:11

Luke Brandon Farrell


Hard to tell what your problem is and I've never used those frameworks. But it sounds like you may have added them to the project in terms of linking against them during compilation, but they are not being added to the final app bundle.

This may or may not help, but based on what you have said, it's what I would look at. Check your 'Build Phases'. You should see the frameworks in the 'Link Binary With Libraries' phase. You then need to look for a phase ( or add one if it's not there) which is a 'Copy files Phase'. Add one by choosing 'New Copy Files Phase' after clicking the '+' at the top of the list.

In the 'Copy Files Phase', set the 'Destination' to 'Frameworks' and then add the Facebook frameworks to the list of file to copy.

Another option which may also work if the above doesn't is to check the 'Runpath Search Paths' in your build settings. If it's not set, try setting it to '@executable_path/Frameworks @loader_path/Frameworks'.

Hope this helps.

like image 43
drekka Avatar answered Nov 17 '22 00:11

drekka


On macOS, in my case, I followed all the instructions but I still got the error. I check again, the files were "there": enter image description here

But actually they're on my iCloud account instead (notice the ones with a little cloud icon). So I downloaded those files to my disk and the app successfully compiled !

like image 37
sonlexqt Avatar answered Nov 16 '22 23:11

sonlexqt