# Build failing with file not found (FBSDK) in IOS build

**URL:** <https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399>\
**Category:** Builds\
**Created:** [January 23, 2017, 2:53pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399 "2017-01-23T14:53:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 2:53pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/1 "2017-01-23T14:53:04Z")

</div>

I have installed the relevant FBSDK frameworks and set the framework search path. I can build the app locally and archive it but the archive step fails on Bitrise.

> /Users/vagrant/git/node\_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h:21:9: ‘FBSDKShareKit/FBSDKShareKit.h’ file not found

> #import \< FBSDKShareKit/FBSDKShareKit.h\>

The framework search path is set to

```
$(PROJECT_DIR)/**

```

and I also have

```
$(SRCROOT)/Frameworks

```

The frameworks are in the repo (under ios/) but Bitrise keeps failing with file not found.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 2:58pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/2 "2017-01-23T14:58:44Z")

</div>

It seems you use `npm` to install the FB SDK - do you run `npm install` as part of your build config / workflow?

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 2:59pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/3 "2017-01-23T14:59:18Z")

</div>

Yes, I have `npm install` set to run after the `git clone`

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 3:00pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/4 "2017-01-23T15:00:08Z")

</div>

Can you please follow this guide [How to debug your build locally / "It works on my Mac/PC but not on bitrise.io"](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392) and let us know how it goes?

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 3:18pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/5 "2017-01-23T15:18:13Z")

</div>

I followed the steps. Did a clean clone of the repo and ran the CLI. The build passed on both primary and deploy workflows. But the deploy workflow still fails on the bitrise machine.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 3:19pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/6 "2017-01-23T15:19:21Z")

</div>

Please send us the related build’s URL or its log in [email](https://www.bitrise.io/contact) or through the onsite chat (Contact Support option).

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 3:25pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/7 "2017-01-23T15:25:52Z")

</div>

I have used the onsite chat. Thanks for the help

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 3:38pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/8 "2017-01-23T15:38:05Z")

</div>

> [@carlmarkham](#):
>
> But the deploy workflow still fails on the bitrise machine.

Can you do one more clean git clone (delete the directory from `/tmp` or use another directory in `/tmp` - don’t reuse the previous one!) and run only the `deploy` workflow with the CLI there?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 3:39pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/9 "2017-01-23T15:39:55Z")

</div>

Please also make sure that you selected the same Xcode version on [bitrise.io](https://www.bitrise.io) as the one you use locally!

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 3:58pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/10 "2017-01-23T15:58:10Z")

</div>

I am using the same Xcode version. I did a new build of the deploy workflow from a new clone and it passed from the CLI, tried another build on the bitrise machine and that is still failing for deploy workflow

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 4:32pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/11 "2017-01-23T16:32:01Z")

</div>

There’s something on your Mac what makes it pass - if the CLI passes locally, that’s exactly the same what happens on [bitrise.io](https://www.bitrise.io), the only difference is the environment, e.g. if you have files on your Mac which are not available on [bitrise.io](https://www.bitrise.io) (because you did not commit it into your repo), or the tool versions.

I wonder, can it be maybe an NPM/Node version difference? It seems you used the Xcode 8.0 stack on [bitrise.io](http://bitrise.io), which has an older Node version preinstalled, although I’m not sure if this is related. The error is code related:

```auto
❌ /Users/vagrant/git/node_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h:21:9: 'FBSDKShareKit/FBSDKShareKit.h' file not found

#import <FBSDKShareKit/FBSDKShareKit.h>
                 ^ ~~~~~~~

```

It seems that the FB SDK is simply not at the path your project configs expect it.

Now that I tried to search for the error, did you create this StackOverflow question? : [http://stackoverflow.com/questions/41749205/react-native-fbsdk-file-not-found-on-ci](http://stackoverflow.com/questions/41749205/react-native-fbsdk-file-not-found-on-ci)

If you did, then it seems locally on your mac you have the FB SDK at `~/Documents/FacebookSDK`, while on [Bitrise.io](http://Bitrise.io) you don’t. If your project is configured to look for the FB SDK at `~/Documents/FacebookSDK` you should download the FB SDK there on [bitrise.io](http://bitrise.io) too.

This would actually explain why it worked on your Mac regardless where you git cloned the repository, as `~/Documents/FacebookSDK` will always be at the same place (`~` means the “HOME” directory), while on [bitrise.io](http://bitrise.io) it seems you don’t download the FB SDK there (from your logs it seems).

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 4:37pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/12 "2017-01-23T16:37:03Z")

</div>

Yes, I did create that question but it is a bit outdated. I removed the reference to the documents folder and replaced it to look up the frameworks in the correct place. However, I have since removed the SDK from my documents folder and can see the build failing locally via the CLI. Seems there must still be a reference to it somewhere.

Will track it down. Thanks for the help

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 4:38pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/13 "2017-01-23T16:38:32Z")

</div>

Yeah, I think this is not a configuration in your code, more likely in a component you install through NPM, which expects the FB SDK to be at `~/Documents/FacebookSDK`, at least from the log it seems to be the case.

Please let us know if you can figure out what causes this issue! At least you can now reproduce this on your own Mac, that should help 😉

---

<div class="post-metadata">

**Author:** ![carlmarkham](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@carlmarkham](https://discuss.bitrise.io/u/carlmarkham)\
**Post date:** [January 23, 2017, 5:45pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/14 "2017-01-23T17:45:17Z")

</div>

I have finally got it working. The issue was indeed linking. The FBSDK npm module had a setup script inside it to download the frameworks and link them. It didn’t work but after reading through the code of the script I was able to link them. They were set up to link to `ios/Frameworks`, however, that folder isn’t the Frameworks folder that is displayed in Xcode, it is another folder which I found using the Finder. I put the frameworks in there and they are linked up now. Deploy workflow is passing now.

Thanks for the help Viktor.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [January 23, 2017, 5:46pm UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/15 "2017-01-23T17:46:58Z")

</div>

Any time 😉

Thanks for sharing the solution, it’ll definitely help others in the future!

---

<div class="post-metadata">

**Author:** ![kyawmoehein](https://avatars.discourse-cdn.com/v4/letter/k/a6a055/32.png) [@kyawmoehein](https://discuss.bitrise.io/u/kyawmoehein)\
**Post date:** [April 18, 2017, 5:06am UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/16 "2017-04-18T05:06:42Z")

</div>

Hi Carl,

I was not able to find ios/Frameworks folder. I saw it is supposed to be at $(PROJECT\_DIR)/…/…/…/ios/Frameworks but I can’t find it in my React Native project although I used Frameworks. Could you please tell me how to find the folder?

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [April 18, 2017, 9:24am UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/17 "2017-04-18T09:24:49Z")

</div>

Hi @kyawmoehein,

Can you please follow this guide [How to debug your build locally / "It works on my Mac/PC but not on bitrise.io"](http://discuss.bitrise.io/t/how-to-debug-your-build-locally-it-works-on-my-mac-pc-but-not-on-bitrise-io/392) and let us know how it goes?

---

<div class="post-metadata">

**Author:** ![developersHomefriend](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@developersHomefriend](https://discuss.bitrise.io/u/developersHomefriend)\
**Post date:** [June 19, 2017, 9:55am UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/18 "2017-06-19T09:55:41Z")

</div>

Hi there,  
I’m running into the exact same issue right now and I may like for a little more details on what you have done to figure it out.  
You say : “They were set up to link to ios/Frameworks, however, that folder isn’t the Frameworks folder that is displayed in Xcode, it is another folder which I found using the Finder” but could you tell me which are the exact paths you had to change and where please ?  
Because today, the ios\_setup.js in the node\_modules folder is targeting a “./ios/Frameworks/…” which is not the path of the xcode projet which is outside of the node\_modules folder (ROOT/ios/Frameworks/…).  
And I can not put the FBSDK Framework inside “node\_modules/react-native-fbsdk/ios/Frameworks” folder because node\_modules is not tracked by git like expected and I guess it will not change anything during the bitrise build :).  
Can you help me please ?

Thanks.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [June 19, 2017, 10:14am UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/19 "2017-06-19T10:14:49Z")

</div>

> [@developersHomefriend](#):
>
> And I can not put the FBSDK Framework inside “node\_modules/react-native-fbsdk/ios/Frameworks” folder because node\_modules

Where is is on your Mac? And how do you install the (the FB SDK)?

---

<div class="post-metadata">

**Author:** ![developersHomefriend](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@developersHomefriend](https://discuss.bitrise.io/u/developersHomefriend)\
**Post date:** [June 19, 2017, 10:33am UTC](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399/20 "2017-06-19T10:33:31Z")

</div>

Hi and thanks for the quick response.  
The FBSDK is in two locations on my Mac. Into “~/Documents/FacebookSDK” like asked by the React-Native tutorial and into “/Users/{home}/{reposFolder}/{project}/ios/Frameworks/FacebookSDK”. We put the FBSDK into the second location to make the bitrise build works.

And we give to Xcode Framework Search Paths the second location too.

[Next page](https://discuss.bitrise.io/t/build-failing-with-file-not-found-fbsdk-in-ios-build/399.md?page=2)
