Getting this error while building a react-native iOS app on xcode.
Started getting this error after npm install and rpm linking react-native-fs library. But after searching online for a solution, I noticed that many people are getting the same error while installing other react native libraries.
A possible solution suggested by many is,
Adding the following under "Build Settings" -> "Header Search Paths".
$(SRCROOT)/../node_modules/react-native/React - (Recursive)
But no luck with this solution, still getting the same error
In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here: Reliable build on ^0.39.2 fails when upgrading to ^0.40.0).
What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before actually building the react library.
The solution in my case was to:
Disable the parallel builds:
Xcode menu -> Product -> Scheme -> Manage Shemes...
Double click on your application
Build tab -> uncheck Parallelize Build
Add react as a project dependecy
Xcode Project Navigator -> drag React.xcodeproj from Libraries to root tree
Build Phases Tab -> Target Dependencies -> + -> add React
Make sure you disable Parallelise Build and add React target above your target
QUICK FIX (not the best)
Change the import react-native header lines:
#import <React/RCTBridgeModule.h>
#import <React/RCTLog.h>
To:
#import "RCTBridgeModule.h"
#import "RCTLog.h"
Here is an example of changes I had to make for the library I was trying to use: Closes #46 - 'RCTBridgeModule.h' file not found.
Change
#import "RCTBridgeModule.h"
to
#import "React/RCTBridgeModule.h"
For me, this error occurred when I added a new scheme/target (app.staging) in the app and installed pods using pod install.
This issue is occurring due to pods are not shared for all targets. So I need to add newly added target (app.staging) inside the Podfile.
Here is my Podfile.
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'app' do
# Pods for app
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
target 'appTests' do
inherit! :search_paths
# Pods for testing
end
# Pods for staging app // important line below
target 'app.staging'
use_native_modules!
end
For viewers who got this error after upgrading React Native to 0.40+, you may need to run react-native upgrade on the command line.
If Libraries/React.xcodeproj are red in xcode then reinstall node_modules
rm -rf node_modules && yarn
My newly created project from react-native 0.46.3 was red :S I have npm 5.3.0 and yarn 0.24.5 when I did react-native init
I ran into this issue after doing a manual react-native link of a dependency which didn't support auto link on RN 0.59+
The solution was to select the xcodeproj file under the Libraries folder in Xcode and then in Build Settings, change Header Search Paths to add these two (recursive):
$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core
$(SRCROOT)/../../../ios/Pods/Headers/Public
My solution was to remove everything in Libraries like described here
Latest releases of react-native libraries as explained in previous posts and here have breaking compatibility changes. If you do not plan to upgrade to react-native 0.40+ yet you can force install previous version of the library, for example with react-native-fs:
npm install --save -E react-native-fs#1.5.1
I was able to build a debug, but I was unable to build an archive.
I solved this issue by dragging React.xcodeproj found in /node_modules/react-native/React to my root directory in Xcode, then added React as a target dependancy in build phases > target dependencies.
After React Native 0.60 this issue is often caused by a linked library mixed with the new 'auto-linking' feature. This fixes it for me
Unlink old library using
$ react-native unlink react-native-fs
Refresh Pods integration entirely using
$ pod deintegrate && pod install
Now reload your workspace and do a clean build.
I receive this error in any new module I create with create-react-native-module. None of the posted solutions worked for me.
What worked for me was first making sure to run yarn in the newly created module folder in order to create node_modules/ (this step is probably obvious). Then, in XCode, select Product -> Scheme -> React instead of the default selection of MyModuleName.
This error appeared for me after I ran pod install command for the new dependencies. Along with those, React had also been installed. Therefore probably Xcode was confused for path. I removed these lines from PodFile and error was gone. Please note that those removed from here were already linked in Xcode.
target 'app' do
pod 'GoogleMaps'
pod 'Firebase/Auth', '~> 6.3.0'
pod 'Firebase/Database', '~> 6.3.0'
# Removed four pods below and it worked.
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
end
Go to iOS folder in your project and install pod -
$ pod install
If you are getting any error in installation of pod type command-
$ xcode-select -p
Result should be - /Applications/Xcode.app/Contents/Developer
If the path is incorrect then open your iOS project in Xcode and go to: Xcode->preferences->command line tools-> select Xcode
And again install the pod your issue will be fixed.
anhdevit's suggestion in https://github.com/facebook/react-native/issues/24363#issuecomment-488547280 worked for me:
In your terminal, run:
defaults delete com.apple.dt.Xcode
delete the pods folder and the .xcworkspace file
run pod install again in that directory
try to archive again and done
If you want to make it from your editor also open SMobile.xcscheme
And change parallelizeBuildables = "NO"
For me didn't work any from the above solutions and below it is what worked (I had already checked out Parallelize Build and added React)
1. Open XCode --> To Libraries add `$LibraryWhichDoesNotWork.xcodeproj$`
2. Then for your app in the `Build Phases` add to the `Link Binary with Libraries` the file `lib$LibraryWhichDoesNotWork$.a`
I've encountered this issue while upgrading from 0.58.4 to new react-native version 0.60.4. Nothing from what i found on the internet helped me, but I managed to get it working:
Go to build settings, search for 'Header search paths', select the entry, press DELETE button.
I had these values overriden, and looks like they fell back to defaults after deletion. Also Cocoapods was complaining about it with messages in Terminal after pod install:
[!] The `app [Release]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-app/Pods-app.release.xcconfig'. This can lead to problems with the CocoaPods installation
If you want to keep Parallelise Build enabled and avoid the missing header problems, then provide a pre-build step in your scheme to put the react headers into the derived-data area. Notice the build settings are coming from the React project in this case. Yes it's not a thing of beauty but it gets the job done and also shaves a lot of time off the builds. The prebuild step output ends up in prebuild.log. The exact headers you'll need to copy over will depend on your project react-native dependencies, but you'll get the jist from this.
Get the derived data directory from the environment variables and copy the required react headers over.
#build_prestep.sh (chmod a+x)
derived_root=$(echo $SHARED_DERIVED_FILE_DIR|sed 's/DerivedSources//1')
react_base_headers=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Base/#1')
react_view_headers=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Views/#1')
react_modules_head=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Modules/#1')
react_netw_headers=$(echo $PROJECT_FILE_PATH|sed 's#React/React.xcodeproj#Libraries/Network/#1')
react_image_header=$(echo $PROJECT_FILE_PATH|sed 's#React/React.xcodeproj#Libraries/Image/#1')
echo derived root = ${derived_root}
echo react headers = ${react_base_headers}
mkdir -p ${derived_root}include/React/
find "${react_base_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_view_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_modules_head}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_netw_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_image_header}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
The script does get invoked during a build-clean - which is not ideal. In my case there is one env variable which changes letting me exit the script early during a clean.
if [ "$RUN_CLANG_STATIC_ANALYZER" != "NO" ] ; then
exit 0
fi
react-native version 0.67.4 (recently updated) This build error started to show up in ios.
I found under my project > Edit Scheme > Build
There was a reference to "React" but it indicated "Missing"
So I removed it (little - button) and added React back (little + button) via the popup which has a Pods folder and a "React" pod project present.
So it looks like react-native used to supply a project file that you would set as a build target in the scheme: /node_modules/react-native/ReactReact.xcodeproj
However with this newer version of react that project is not present, which would explain why building will fail if you have a native module bridge (its searching for header files that don't exist)
I no longer get the build error, but I haven't verified it works. Will update once I get a positive outcome (or a negative one for that matter). Even if this does fix it, I am not sure if this is the "right" way, but I'm certainly open to suggestions.
In my case, the wrong target was selected in podfile, after correcting that, I was good to go.
In my case, I removed the 'arm64' from the release section located under Excluded architectures in the targets project
What you can do to get it right is:
1) npm uninstall reat-native-fs to uninstall library
2)npm unlink react-native-fs to unlink the library
Now the library is successfully removed and now install the lib again in your project and this time link everything manually. Sometime automatic linking causes this error.
Related
I spent my day trying to fix my problem, I tried every solution I found in other SO posts but unfortunately I can't figure out how to solve my problem.
I try to integrate TouchID inside my react-native project. I downloaded a npm package called "react-native-touch-id" (sounds perfects !). I followed installation guide and I manually linked library to my project.
But when I try to run application I get the following error :
I tried to clean my project :
rm -rf node_modules
yarn cache clean && yarn install
rm -rf ios/Pods/ && pod install
In xCode I even clean the build folder.
About my versions :
RN : 0.57.4
xCode : 10.1
react-native-touch-id : 4.3.0
Here's my Podfile :
def available_pods
pod 'TouchID', :path => "../node_modules/react-native-touch-id"
end
target 'App' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
available_pods
end
I added the .xcodeproj of react-native-touch-id package inside my project's libraries directory and in Build Phases I linked it.
But I still getting the same error again and again ... I don't understand why ... If someone have an idea some help would be really appreciated :)
It appeared the problem was the Podfile. It seems that Podfile use its own Podspec which caused troubles. So I simply delete the TouchId pod declaration from my Podfile, clean and re-install my pods.
Then, I manually linked the library to my xcode workspace. To do that, under your project name, Right Click on Libraries directory => Add files to "your project name" => Add the xcodeproj of the npm's package located inside your node_modules directory.
After that, in your project Build Phases under the Link Binary with Libraries you have to add the npm's package static library (example libTouchID.a in my case).
To be sure you can clean your project and try to rebuild, it should work now.
For information, I kept all of my softwares version I mentionned above.
If it shows react native(missing) in
product->scheme->manage scheme->project name->build
remove the ios folder
react-native eject
cd ios/
pod init
pod install
cd ..
react-native link
cd ios
open *.xcworkspace/
this happens when the react native package is not linked properly to the ios build. The npm link does it.
I am trying to run my React Native app in XCode and I keep getting this error. I cannot figure out how to resolve the issue. Any suggestions?
Screen Shot of Error in XCode:
xcode Product->Scheme->Manage Schemes click '+' at the Target to select "React" and set the React is shared.
Delete node modules, then run npm install (or better yet yarn) and after everything has finished downloading, run react-native upgrade which should give you the option to replace old files with the template ones, by doing so you re-link your native dependencies in react-native which should fix your problem. Of course don't forget to clean your project in Xcode.
For all those are using React Native 0.40.0 or higher, Header Imports have a major change from RN 0.40.0 and result in lots of .h file not found errors. react-native-git-upgrade fixed the issue for me while in debug but build fails in release/archive.
I am using RN 0.42.3 with cocoapods and Xcode 8.2.1
To completely fix this go to Xcode>Product>Scheme>Edit Scheme>
Untick Parallelize Build
Click on + button in Targets and add React
Drag the added React to top of the List in Targets.
Now clean the project and build
None of the other suggestions were fixing my error but this one did it.
1 - Create Podfile
Create a file named ios/Podfile inside your react-native app with the following contents:
# You Podfile should look similar to this file. React Native currently does not support use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target '<YOUR_APP_NAME>' do
# Fixes required for pod specs to work with rn 0.42
react_native_path = "../node_modules/react-native"
pod "Yoga", :path => "#{react_native_path}/ReactCommon/yoga"
pod "React", :path => react_native_path, :subspecs => [
'Core',
'RCTActionSheet',
'RCTAnimation',
'RCTGeolocation',
'RCTImage',
'RCTLinkingIOS',
'RCTNetwork',
'RCTSettings',
'RCTText',
'RCTVibration',
'RCTWebSocket'
]
pod 'GoogleMaps' # <~~ remove this line if you do not want to support GoogleMaps on iOS
# when not using frameworks we can do this instead of including the source files in our project (1/4):
# pod 'react-native-maps', path: '../../'
# pod 'react-native-google-maps', path: '../../' # <~~ if you need GoogleMaps support on iOS
end
2 - Install Podfile
Run the command pod install from inside the ios folder.
3 - Reset XCode
Restart XCode and the error should be gone.
The solution that works for me is to share React scheme.
If you don't have React scheme, create new one by Selecting scheme menu -> Manage Scheme -> + -> choose React, then mark React scheme as Shared
Also, if you use Xcode 10, go to File -> Project Settings and select Legacy build system
I ran into this problem after my first try running a React build in XCode, and all I had to do was actually build and run to make the error go away (after picking a team and proper provisioning). Sometimes XCode shows errors that aren't really errors until it compiles and links things the first time.
I solved this problem by following steps:
In xcode choose project root.
Drag React.xcodeproj from Libraries to the root of the project.
Click on project name (in my case it name SaleKit) in TARGETS
Choose Build Phases
In dropdown of Target Dependencies add React
Rebuild or re-run
For my case in ReactNative "0.54.2", i solved it with following solution
In Xcode select Product->Scheme->Manage Schemes, untick 'YourProject'-tvOS set it to not Shared
Best Solution :
Open 'Build Settings' for your project in Xcode , search 'Header Search Path'.
Double click next to 'Header Search Path', where other properties have a 'yes' or 'no'
Now add following to the "Header Search Path" (under Build Settings):
$(SRCROOT)/../node_modules/react-native/React
$(SRCROOT)/../node_modules/react-native/React/Base
Don`t forget Make both of them recursive.
You might be running .xcodeproj file after pod is installed.
Close it and open .xcworkspace file. It worked for me.
In the base dir of the project I run:
node_modules/react-native/packager/packager.sh --reset-cache
Which resulted in:
Scanning 554 folders for symlinks in /Users/..../work/..../react_tutorial/AwesomeProject/node_modules (15ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
/Users/..../work/...../react_tutorial/AwesomeProject
Loading dependency graph... ERROR Packager can't listen on port 8081
Most likely another process is already using this port
Run the following command to find out which process:
lsof -i :8081
I found that package manager can't run when another packager process is running.
I found the process running with:
lsof -i :8081
Than I kill 9 ... the process.
After than I closed Xcode, run:
npm install
And started Xcode again, from this moment everything work as expected!!
I had the same issue and I fixed it by placing RNFIRMessaging.h above the React/RCTBundleURLProvider.h
So it look I will look like:
#import "AppDelegate.h"
#import "RNFIRMessaging.h"
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
Try the following:
Clean (cmd+shift+K).
Build core React - select React as the scheme in Xcode and build it (cmd+B).
Build the library that is failing (e.g. RCTText).
Build your app.
click Product->Scheme->Manage Schemes->+ . and then add react as shared. also insure that your project name is there too.
I faced same issue .then i have deleted node .try to use these steps
Delete the node_modules folder - rm -rf node_modules && npm install
Reset packager cache - rm -fr $TMPDIR/react-* or
node_modules/react-native/packager/packager.sh --reset-cache
Clear watchman watches - watchman watch-del-all
then make build and see
I found that my fix to this issue after upgrading React was to change the declaration of #import "RCTBundleURLProvider.h" to #import <React/RCTBundleURLProvider.h>
Run npm install in your project directory to install react-native resolving this error.
For me replacing
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
by
#import <RCTBundleURLProvider.h>
#import <RCTRootView.h>
in AppDelegate.m file worked.
If you havent run npm install you are likely to encounter this issue.
I have gone through all the answers mentioned above.
Here is the solution worked for me:
STEP 1:
Run:
npm install react-native-fcm --save
This result in making the directory in your project under node_modules > react-native-fcm
STEP 2:
You need to add '$(SRCROOT)/../node_modules/react-native-fcm/ios' to
header search paths in build settings.
These 2 steps worked for me to remove the error.
For more details you can go through these links:
https://github.com/evollu/react-native-fcm/issues/63
https://github.com/evollu/react-native-fcm/issues/21
For my case, I couldn't delete node_modules and re-install and I also couldn't do react-native-git-updgrade or react-native upgrade because I wanted to stay on RN-0.59 because .60 causes problems for my dependencies.
Anyway my situation was that I was missing 'React/RCTBundleURLProvider.h' file. I already had React available in my schemas. It was not in my libraries directory. I checked my target's build settings.
Inside target dependencies, I also had React in there.
I deleted 'React' target dependency, then re-added. cleaned build folders, re-built project. it worked.
I am using React Native 0.61. I created a Share Extension and was getting this error. I needed to replace:
#import "RCTBundleURLProvider.h"
with
#import "React/RCTBundleURLProvider.h"
https://github.com/facebook/react-native/blob/v0.63.3/template/ios/Podfile
Find/Replace HelloWorld with your your project name.
Place this file into the ./ios folder in your project
gem install cocoapods
cd ios
pod install
Then open the YourProject.xcworkspace file in XCode
in XCode, go to Product -> Scheme -> Manage Schemes and check React
Then try building the project again.
I tried all the suggestions and none of them worked at the i deleted the repo and clone it again and that work for me, so my suggestion is commit your changes back them up and clone the repo again that worked for me.
you need to install react native,
in terminal run
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
then
brew install node
brew install watchman
npm install -g react-native-cli
source:
https://facebook.github.io/react-native/docs/getting-started.html
Make sure that the path to your project don't have any spaces.
Just renaming folders and deleting spaces solves the problem for me.
I am implementing FB Login so i Downloaded the SDK from https://developers.facebook.com/docs/ios.
then i drag n down FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit frameworks into my project.
when i ran project it works fine. but when i closed and reopen it, then "FBSDKCoreKit/FBSDKCoreKit.h not found error" appears. then again i copy paste FBSDKCoreKit framework into my project's library
and error disappear and this process continues. anyone faced this problem before?
what should i do to solve this error?
Make sure to follow this step:
Deselect Copy items into destination group's folder.
https://developers.facebook.com/docs/ios/getting-started/
Also, in your Build Settings, look at this field: "Framework Search Paths"
You should have something like this:
/Users/[username]/Documents/FacebookSDK
or for a more general config
~/Documents/FacebookSDK
Also, look at Finder and make sure that the framework is actually there
After updating Cocoapods 1.0.0, I deleted pod.lock and installed the current stable pod versions (4.7.0 to 4.11.0) of FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit
Then i encounter the same error. What i did was:
Added Header Search Paths Build Settings in Xcode:
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"
Then i still had error for another file. Because XCode is using prebuild frameworks.
FBSDKCoreKit/FBSDKCopying.h not found
Clean Build -> ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
Clean Build Folder -> ⌥⇧⌘K (Option+Shift+Command+K)
Close Xcode // important! - Otherwise it recreate the DerivedData for the current open project automatically
Run this command in terminal
rm -rf ~/Library/Developer/Xcode/DerivedData
Open XCode and build successfully
I got to solve this by deleting the Framework and adding it again by right click on the project->Add files..., then choose the framework and SELECT the option to Copy files if needed. I know it's not what Facebook recommends, but I couldn't make it work doing that, but this way it worked!
I'm using v4.6 of FBSDK and Xcode 7 beta 6.
Hope it helps you and everyone else who's facing the same problem :)
This also took me hours of pain! Finally I found the root problem.
The Facebook SDK MUST be located at ~/Documents/FacebookSDK
This is because in the RCTFBSDK project this path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project (it will be shown in the error console)!
FB developers say don't select copy files. Which creates problem. But I did opposite.
I selected copy items if needed. It copied Frameworks in my project. Also automatically Search Path was added by xcode 7.2.
Also double check if there is nothing in Framework Search Pathsunder Search Paths under Build Settings fields, then just add $(PROJECT_DIR) which is equal to /Users/user/Documents/....PROJECT..DIR...
Compiled in 2 projects successfully.
I had to move FacebookSDK path in Framework Search Paths above $(PROJECT_DIR)
$(SRCROOT)/../../../Documents/FacebookSDK
$(inherited)
$(PROJECT_DIR)
Xcode 11 + CocoaPods solution
In root of your project, i.e. the same path where you have MyApp.xcworkspace open Terminal and init pod's pod init, then add the required FBSDK pods - your Podfile should look something like that:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
end
Now in your Terminal pod install and open MyApp.xcworkspace (which is not MyApp.xcodeproj). Go to MyApp -> Build Phases -> Link Binary with Libraries and you should see at the bottom of the list of frameworks Pods_MyApp.framework. If you'd click + below Pods_MyApp.framework you should in new window below Workspace a list of Pods where all related to FBSDK should be.
Note: Make sure you're installing FBSDK, not Facebook SDK, because the second one is outdated.
If any of the above answers didn't work, try this:
Open your ~/Documents/FacebookSDK folder.
Check if there is this cloud icon right of the filenames:
If so, macOS removed your files from your computer and uploaded them to iCloud! (thanks Apple)
You can:
Click on all the cloud icons, it will download the files back
Disable Storage Optimization on your mac to prevent it from happening again
For React Native devs:
Recommended steps to be done :
1.Make sure that the Facebook SDK frameworks are installed in ~/Documents/FacebookSDK.
2)Make sure that FBSDK[Core, Login, Share]Kit.framework show up in
the Link Binary with Libraries section of your build target's Build
Phases.
3)Make sure Framework Search Path of your
build target's Build Settings is
$(HOME)/Documents/FacebookSDK
instead of
~/Documents/FacebookSDK
If it still doesn't work for you then:
1)sudo chmod -R 755 ~/Documents/FacebookSDK
2) set the path of framework search path of RCTFBSDK.xcodeproj to
$(HOME)/Documents/FacebookSDK
(under libraries of your project folder )
set RCTFBSDK framework searchpath as here
clean your project (command+ shift + k ) and build.
Solution to the problem if your FacebookSDK is different than
~/Documents/FacebookSDK
Because you don't want iCloud Drive to load up with FacebookSDK;
you have to change the "Framework Search Paths" for the added
react-native-fbsdk
This is because in the RCTFBSDK.xcodeproj inside Libraires; path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project.
Select the Project
Libraries
Select "RCTFBSDK.xcodeproj"
Build Settings
Add your custom path in "Framework Search Paths"
eg: /Users/rajanmaharjan/FacebookSDK
Clean Build -> ⇧⌘K (Shift + Command + K) - to clean build frameworks.
Build the project; it should build successfully.
I had the same problem. I fixed it by using quotes around my framework search path value i.e. "/Users/.....". Obviously, I have some spaces in my file paths.
I have the same issue.I use Facebook SDK version 4.10.0.I known my solution is not good but worked for me. I changed the Facebook source code.
Changed the import file path from #import <FBSDKCoreKit/FBSDKCoreKit+Internal.h> to #import <FBSDKCoreKit/Internal/FBSDKCoreKit+Internal.h>
Using CocoaPods, the only thing that worked for me was:
Update Header Search Paths ( NOT Framework Search Paths ) under Build Settings in Xcode:
- "\"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"",
- "\"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"",
+ "\"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"",
+ "\"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"",
Add the missing header(s?):
cd Pods/Headers/Public/FBSDKCoreKit/FBSDKCoreKit/ && ln -s ../../../../FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKCoreKit+Internal.h FBSDKCoreKit+Internal.h
Edit: point 2. needs apparently to be repeated after each following call to pod install.
For Xcode 7.3, the below worked for me.
Follow the steps mentioned on FB's guide and additionally do the below:
step 1. go to Document/FacebookSDK folder
step 2. Click FBSDKCoreKit.framework
step 3. In this folder Remove Modules folder and then drag and drop in your Xcode Project.
References : https://stackoverflow.com/a/29532202
Thanks
For people moving from Carthage to Cocoapods make sure to remove the Carthage references of the FBSDKCoreKit from the Link Binary With Libraries under Build Phases option.
I had a similar issue, and could not resolve the compiler error anyway.
I followed and performed the exact integration steps a few times, until I noticed that I have a copy of the FBSDKCoreKit.framework inside my project folder (happened probably by a mistake). In addition the Framework Search Paths already contains $(PROJECT_DIR) besides /Users/{username}/Documents/FacebookSDK.
So I've removed the copy of the FBSDKCoreKit.framework from the project's directory and now everything works fine.
I ran into this issue last night, and wanted to post my solution just in case someone else has the same problem. My problem was my app was building and running fine in the sim and on my device, however the build would fail because of FBSDKCoreKit whenever I tried to run my unit tests. It took my about 30 minutes to find the problem, and I felt like a dummy when I did.
Make sure that the FBSDKCoreKit bundle is targeted for your tests as well, and not just your regular application build.
I had this problem when upgrading to Xcode 8 and was able to solve it by changing
#import <FBSDKCoreKit / FBSDKCoreKit.h>
to
#import <FBSDKCoreKit/FBSDKCoreKit.h>
When you add the directory to your Build Settings -> "Framework Search Paths", make sure you add it to both Debug AND Release.
Silly error but if you're new to iOS dev in xcode you could miss this.
Personally I had trouble with spaces in various paths, including app name. Removing spaces (or adding "" everywhere to secure paths) solved the problem.
I had similar issue. Fix consisted for me in selecting: "COPY FILES IF NECESSARY" when manually adding the different frameworks into XCode framework.
I dragged the framework to the Framework folder inside xcode, chose to copy files if needed and all worked fine without any other configuration change.
I have installed react-native-fbsdk and link using react-native-link react-native-fbsdk.
Follow instruction of following link
https://developers.facebook.com/docs/react-native/configure-ios
This provide to link react-native library using ios_setup.js There are following step which i have followed.
Setup on facebook developer account.
Install the file ios_setup.js by executing the following command in
a command prompt at your project's root folder.
curl -O https://raw.githubusercontent.com/facebook/react-native-fbsdk/master/bin/ios_setup.js
Install the plist package, the xcode package, and the adm-zip package, by executing the following command.
npm install plist xcode adm-zip
Run the script ios_setup.js by executing the following command, and insert your app's App ID and App Name. If the name of your app is more than one word long, then enclose it between quotation marks.
node ios_setup.js [App ID] [App Name]
When run node ios_setup.js it wll automatically link all files in ios.
After troubleshooting using several answers here. This is what I did.
I changed ~/Documents/FacebookSDK to "$(HOME)/Documents/FacebookSDK" note: I used quotes "
I moved "$(HOME)/Documents/FacebookSDK" to the top of the list in header search paths.
Had a same error in FBSDKLoginKit
If you use multiple pod projects
install! 'cocoapods',
:generate_multiple_pod_projects => true
Then you should force cocoapods to put all of FBSDK pods into a same project to make private headers visible
pod 'FBSDKCoreKit', '5.11.0', :project_name => 'FBSDK'
pod 'Bolts', '1.9.0', :project_name => 'FBSDK'
pod 'FBSDKShareKit', '5.11.0', :project_name => 'FBSDK'
pod 'FBSDKLoginKit', '5.11.0', :project_name => 'FBSDK'
Xcode with Facebook and iOS working - Step By Step
After much frustration I got my Iphone game building just fine. Following a combination of Ixgee's solution, and other solutions.
Fixes - FBSDKCoreKit.h not found and other related issues
I'm using Unity and Facebook SDK v11
Unity -> ExternalDependencyManager -> IOS Resolver Settings - make it build to a Xcode project and make sure all the checkboxes are checked.
MacOS -> move project to Mac. In Terminal in the project directory do the ‘sudo chmod +x process_symbols.sh’
2.5 Make sure you have cocoa pods installed. In Terminal type ‘sudo gem install cocoapods’
MacOS->Podfile - the pod file in your project should look like this for Facebook SDK 11
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'FBSDKCoreKit', '~> 11.1.0', :modular_headers => true
pod 'FBSDKCoreKit_Basics', '~> 11.1.0'
pod 'FBSDKGamingServicesKit', '~> 11.1.0'
pod 'FBSDKLoginKit', '~> 11.1.0'
pod 'FBSDKShareKit', '~> 11.1.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
use_frameworks!
[Only needs to be done once. If your Mac processor uses an ARM processor (like the M1)]] Terminal -> Type ‘sudo arch -x86_64 gem install ffi’
Solution from - https://github.com/CocoaPods/CocoaPods/issues/10723 [super helpful!]
[If your Mac processor uses an ARM processor (like the M1)] Terminal -> ‘arch -x86_64 pod install’
Or
[If your Mac processor uses an x86 processor (like an Intel)] Terminal -> ‘pod install’
Once the Pod Install is successful, double click the newly created ‘Unity-iPhone.xcworkspace’ in your project directory to open the workspace in Xcode.
Xcode->The folder option -> Unity-IPhone-> under Projects select ‘UnityFramework’-> select ‘Build Phases’ then drag the ‘> Headers’ above the ‘> Compile Sources’
-Full details here (https://forum.unity.com/threads/xcode-version-13-3-13e113-error-cycle-in-dependencies.1268720/)
Xcode -> In the Unity-phone - Build Settings -> Set - ALWAYS EMBED SWIFT STANDARD LIBRARIES: YES
In the UnityFramework - Build Settings -> Set - ALWAYS EMBED SWIFT STANDARD LIBRARIES: NO
Source - Validation Error: Invalid Bundle. The bundle at ... contains disallowed file 'Frameworks'
VOILA! It builds to your iPhone with Facebook SDK Dependencies good to go on iOS!!!
->Builds Configuration.
-> Framework Search paths.
put the FacebookSDK directory in my case
~/Documents/FacebookSDK in :
Debugging,
Any architecture I Any Sdk,
Release.
especially this error because there no path in Any architecture I Any Sdk
in my case
~ / Documents / FacebookSDK
and it should be noted that the FacebookSDK folder must be in Domuments
Example
https://photos.app.goo.gl/5bD4d39a11AalYsx1
Change the /Users/[username]/Documents/FacebookSDK/ directory to Documents/FacebookSDK like so:
I have got the following errors after trying multiple answers from the google.
PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-
iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.sh
cd "/Users/apple/Downloads/FoodSpot 2"
/bin/sh -c /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.sh
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock.
Run 'pod install' or update your CocoaPods installation.
I have updated and installed many times, but they are of no use.
For me, the reason was missign User-Defined variables in the Build Settings!
Looking into the issue, the Build Phases tries to diff 2 files.
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
Just because of missing PODS_PODFILE_DIR_PATH and PODS_ROOT variables, assumes them as "" so ${PODS_PODFILE_DIR_PATH}/Podfile.lock points to /Podfile.lock and same for the other one.
So it fails in
diff /Podfile.lock and /Manifest.lock
I fixed this by adding 2 User-Defined settings to the Build Settings
PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
After hours of searching this is the only solution that worked for me
For me, it works after the following:
pod deintegrate --verbose
pod install --verbose
Run 'pod install' or update your CocoaPods installation.
You have answer in the error itself !
The error message states that you should update your CocoaPods installation.
You could remove libPods in frameworks and libraries and update Cocoapods using pod install.
Also:
clean and build the project
SO references :
CocoaPods Errors on Project Build
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
I had been searching for hours and I found solutions as follow:
In my case, method 3 works.
Method 1:
choose the target > go to Build Phrases > click Link Binary With Libraries > remove all libPods.a files
open Terminal > direct to your project > run:
pod install
clean and build project
ref.1
Method 2:
open Terminal > direct to your project > run:
pod deintegrate --verbose
pod install --verbose
ref.2
Method 3:
choose the target > go to Build Settings > click "+" sign
add 2 User-Defined Settings: [to the left = to the right]
PODS_ROOT = ${SRCROOT}/Pods
and
PODS_PODFILE_DIR_PATH = ${SRCROOT}/
ref.3
Just go to Build phases and click on [CP]check Pods Manifest.lock.
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
Both PODS_PODFILE_DIR_PATH and POD_ROOT should define in user-Defined in build settings.
POD_ROOT should have correct path to Manifext.lock file and
POD_PODFILE_DIR_PATH should have correct path for Podfile.lock
So Add below in build settings.
PODS_ROOT ---- ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH ---- ${SRCROOT}
The problem is Podfile.lock and Manifest.lock cannot be found by the Check Pods Manifest.lock Script in your targets build phase.
This is usually caused by PODS_PODFILE_DIR_PATH and PODS_ROOT variables not being defined.
Go to build settings tab to define them.
You will need to look for Podfile.lock and Manifest.lock in your project and get the the full paths of their directories. The directory paths will be the values you use for PODS_PODFILE_DIR_PATH and PODS_ROOT.
Deleting the derived data did the trick for me . I deleted by going into the finder itself.
Make changes in the podfile as given below:
Older pod file
target :TargetName, :exclusive => true do
Changed pod file
target 'TargetName' do
I'm pretty sure that you have opened your Projects' workspace which you try to install new Pods. So try out the following (for me this worked):
Clean the project
Close the project
Run pod install
Open the project and try re-building it once more
Problem might have been resolved.
Edit
It turned out my issue was due to a new line at the end of the Manifest.lock that was not present in the PodFile.lock file. Running a diff on the two files highlighted the issue.
Adding a new line to the end of the PodFile.lock file solved it.
Original Answer
None of the answers have worked for me so I have just checked the "For install builds only" under "[CP] Check Pods Manifest. lock" which is found in the build phases tab.
I believe this setting means it will only run that check when archiving, allowing me to continue developing as I don't need to archive the app on my machine.
Use with caution though as it may not be the best solution for everyone.
This happens if cocoa pods don't install or uninstall properly
If you want to install cocoa pods run
pod install
if you you want to uninstall cocoa pods then run command
pod deintegrate
I had the same issue. Turned out the cocoapods version on Manifest.lock was higher than what I had on my mac. I had to do a 'sudo gem install cocoapods', to get the version of the cocoapods upto what was specified on the Manifest.lock file. This fixed the issue and I had no errors on building the project.
Im facing the same issue now and fixed using this command after navigating to project location in terminal.
pod install --repo-update
I fixed this by adding 2 User-Defined settings to the Build Settings
PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
In my case, I got same error after integrating my other targets. To solve problem I needed to add both targets in Podfile:
abstract_target 'myApp' do
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'SwiftyJSON'
target 'myAppOtherTarget'
end
Make sure you add a "pod install" command line build step, before the Xcode Project build step.
The error is coming from the build phase run script in your Xcode project's target, which is unable to find Podfile.lock. This file is generated by CocoaPods, which must be installed in a build step in your TeamCity project.
My build steps look like:
Command line: bundle install --path .bundle (installs cocoapods local to the project using Gemfile).
Command line: bundle exec pod install --verbose (uses Podfile)
Command line: carthage update --platform iOS (uses Cartfile)
Xcode Project
Command line to build an archive
Command line to upload a build
Hope this helps.
In my case, the errors were occurring on a _Tests target. I didn't need the _Tests target, and so I deleted it. This resolved the error.
If you happen to move your Podfile like i did and face this issue, the solution discussed below may help -
Delete all of the following - Pods folder, xcworkspace
file, podlock file (skip the ones that are not available for subfolders)
delete all steps that has [cp] in it from the build phase tab
repeat step 1 & 2 for all the sub projects that you have in your workspace
open workspace, go into each project and delete framework for pods, and delete the pods folder from each project
close workspace
run pod install
you should now be able to open, build and run the project
I just fixed it by updating the Cocoapod, cause before the error there was log where the warning shows we need to upgrade our cocoapods as the pod files are not supported by the current cocoapod version, So clean the project , upgrade cocoapod then install pod.
1. Clean project
2. sudo gem install cocoapods/gem install cocoapods
3. pod install (optional if your project still shows error)
Note: I found this error for my flutter application in iOS platform
I think you are trying to use your old project pod folder in your current project, you have to copy Manifest.lock file of your current project and replace that file in your old project's pod folder which you added. Manifest.lock file location YourProject->Pods->Manifest.lock
Hope This was helpful. worked for me!
Please check Top Sites - Sandbox Sync iOS for more explanation. I fixed the issue by changing file paths from
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
to
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
in Xocde -> "Open Your Project" -> "Select Your Project" -> "Select Your Target" -> Build Phases -> Check Pods Manifest.lock
If not, try changing paths as mentioned above, along with Legacy Build System. To change build system Xcode -> File -> Workspace Settings -> Build System -> Legacy Build System
I hate to say this, but I just removed the pods/ or didn't include them in the project and it built. I don't know if this will have a long-term effect on the project though.
This is presently my .sh build script for ionic5 for ios. It will probably change in the future.
# BUILDING FOR IOS
##################################
#
# MAKE SURE YOU UNPLUG ALL DEVICES!!!!!
#
##################################
ionic cordova platform remove ios
ionic cordova prepare ios
ionic cordova platform add ios
ionic cordova build ios --prod --release --buildFlag="-UseModernBuildSystem=0" --verbose
cd platforms
cd ios
open "MyApp.xcworkspace/"
cd ..
cd ..
It had be plaguing my project, so I thought I'd take them out. I am yet to deploy the project so far though... so who knows.
BigSur 11.1, XCode 12.4 (12D4e)
I am implementing FB Login so i Downloaded the SDK from https://developers.facebook.com/docs/ios.
then i drag n down FBSDKCoreKit, FBSDKLoginKit and FBSDKShareKit frameworks into my project.
when i ran project it works fine. but when i closed and reopen it, then "FBSDKCoreKit/FBSDKCoreKit.h not found error" appears. then again i copy paste FBSDKCoreKit framework into my project's library
and error disappear and this process continues. anyone faced this problem before?
what should i do to solve this error?
Make sure to follow this step:
Deselect Copy items into destination group's folder.
https://developers.facebook.com/docs/ios/getting-started/
Also, in your Build Settings, look at this field: "Framework Search Paths"
You should have something like this:
/Users/[username]/Documents/FacebookSDK
or for a more general config
~/Documents/FacebookSDK
Also, look at Finder and make sure that the framework is actually there
After updating Cocoapods 1.0.0, I deleted pod.lock and installed the current stable pod versions (4.7.0 to 4.11.0) of FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit
Then i encounter the same error. What i did was:
Added Header Search Paths Build Settings in Xcode:
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"
Then i still had error for another file. Because XCode is using prebuild frameworks.
FBSDKCoreKit/FBSDKCopying.h not found
Clean Build -> ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
Clean Build Folder -> ⌥⇧⌘K (Option+Shift+Command+K)
Close Xcode // important! - Otherwise it recreate the DerivedData for the current open project automatically
Run this command in terminal
rm -rf ~/Library/Developer/Xcode/DerivedData
Open XCode and build successfully
I got to solve this by deleting the Framework and adding it again by right click on the project->Add files..., then choose the framework and SELECT the option to Copy files if needed. I know it's not what Facebook recommends, but I couldn't make it work doing that, but this way it worked!
I'm using v4.6 of FBSDK and Xcode 7 beta 6.
Hope it helps you and everyone else who's facing the same problem :)
This also took me hours of pain! Finally I found the root problem.
The Facebook SDK MUST be located at ~/Documents/FacebookSDK
This is because in the RCTFBSDK project this path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project (it will be shown in the error console)!
FB developers say don't select copy files. Which creates problem. But I did opposite.
I selected copy items if needed. It copied Frameworks in my project. Also automatically Search Path was added by xcode 7.2.
Also double check if there is nothing in Framework Search Pathsunder Search Paths under Build Settings fields, then just add $(PROJECT_DIR) which is equal to /Users/user/Documents/....PROJECT..DIR...
Compiled in 2 projects successfully.
I had to move FacebookSDK path in Framework Search Paths above $(PROJECT_DIR)
$(SRCROOT)/../../../Documents/FacebookSDK
$(inherited)
$(PROJECT_DIR)
Xcode 11 + CocoaPods solution
In root of your project, i.e. the same path where you have MyApp.xcworkspace open Terminal and init pod's pod init, then add the required FBSDK pods - your Podfile should look something like that:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
end
Now in your Terminal pod install and open MyApp.xcworkspace (which is not MyApp.xcodeproj). Go to MyApp -> Build Phases -> Link Binary with Libraries and you should see at the bottom of the list of frameworks Pods_MyApp.framework. If you'd click + below Pods_MyApp.framework you should in new window below Workspace a list of Pods where all related to FBSDK should be.
Note: Make sure you're installing FBSDK, not Facebook SDK, because the second one is outdated.
If any of the above answers didn't work, try this:
Open your ~/Documents/FacebookSDK folder.
Check if there is this cloud icon right of the filenames:
If so, macOS removed your files from your computer and uploaded them to iCloud! (thanks Apple)
You can:
Click on all the cloud icons, it will download the files back
Disable Storage Optimization on your mac to prevent it from happening again
For React Native devs:
Recommended steps to be done :
1.Make sure that the Facebook SDK frameworks are installed in ~/Documents/FacebookSDK.
2)Make sure that FBSDK[Core, Login, Share]Kit.framework show up in
the Link Binary with Libraries section of your build target's Build
Phases.
3)Make sure Framework Search Path of your
build target's Build Settings is
$(HOME)/Documents/FacebookSDK
instead of
~/Documents/FacebookSDK
If it still doesn't work for you then:
1)sudo chmod -R 755 ~/Documents/FacebookSDK
2) set the path of framework search path of RCTFBSDK.xcodeproj to
$(HOME)/Documents/FacebookSDK
(under libraries of your project folder )
set RCTFBSDK framework searchpath as here
clean your project (command+ shift + k ) and build.
Solution to the problem if your FacebookSDK is different than
~/Documents/FacebookSDK
Because you don't want iCloud Drive to load up with FacebookSDK;
you have to change the "Framework Search Paths" for the added
react-native-fbsdk
This is because in the RCTFBSDK.xcodeproj inside Libraires; path is hardcoded. But you can add your custom location by adding it to the Framework Search Paths of the RCTFBSDK project.
Select the Project
Libraries
Select "RCTFBSDK.xcodeproj"
Build Settings
Add your custom path in "Framework Search Paths"
eg: /Users/rajanmaharjan/FacebookSDK
Clean Build -> ⇧⌘K (Shift + Command + K) - to clean build frameworks.
Build the project; it should build successfully.
I had the same problem. I fixed it by using quotes around my framework search path value i.e. "/Users/.....". Obviously, I have some spaces in my file paths.
I have the same issue.I use Facebook SDK version 4.10.0.I known my solution is not good but worked for me. I changed the Facebook source code.
Changed the import file path from #import <FBSDKCoreKit/FBSDKCoreKit+Internal.h> to #import <FBSDKCoreKit/Internal/FBSDKCoreKit+Internal.h>
Using CocoaPods, the only thing that worked for me was:
Update Header Search Paths ( NOT Framework Search Paths ) under Build Settings in Xcode:
- "\"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"",
- "\"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"",
+ "\"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"",
+ "\"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"",
Add the missing header(s?):
cd Pods/Headers/Public/FBSDKCoreKit/FBSDKCoreKit/ && ln -s ../../../../FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/Internal/FBSDKCoreKit+Internal.h FBSDKCoreKit+Internal.h
Edit: point 2. needs apparently to be repeated after each following call to pod install.
For Xcode 7.3, the below worked for me.
Follow the steps mentioned on FB's guide and additionally do the below:
step 1. go to Document/FacebookSDK folder
step 2. Click FBSDKCoreKit.framework
step 3. In this folder Remove Modules folder and then drag and drop in your Xcode Project.
References : https://stackoverflow.com/a/29532202
Thanks
For people moving from Carthage to Cocoapods make sure to remove the Carthage references of the FBSDKCoreKit from the Link Binary With Libraries under Build Phases option.
I had a similar issue, and could not resolve the compiler error anyway.
I followed and performed the exact integration steps a few times, until I noticed that I have a copy of the FBSDKCoreKit.framework inside my project folder (happened probably by a mistake). In addition the Framework Search Paths already contains $(PROJECT_DIR) besides /Users/{username}/Documents/FacebookSDK.
So I've removed the copy of the FBSDKCoreKit.framework from the project's directory and now everything works fine.
I ran into this issue last night, and wanted to post my solution just in case someone else has the same problem. My problem was my app was building and running fine in the sim and on my device, however the build would fail because of FBSDKCoreKit whenever I tried to run my unit tests. It took my about 30 minutes to find the problem, and I felt like a dummy when I did.
Make sure that the FBSDKCoreKit bundle is targeted for your tests as well, and not just your regular application build.
I had this problem when upgrading to Xcode 8 and was able to solve it by changing
#import <FBSDKCoreKit / FBSDKCoreKit.h>
to
#import <FBSDKCoreKit/FBSDKCoreKit.h>
When you add the directory to your Build Settings -> "Framework Search Paths", make sure you add it to both Debug AND Release.
Silly error but if you're new to iOS dev in xcode you could miss this.
Personally I had trouble with spaces in various paths, including app name. Removing spaces (or adding "" everywhere to secure paths) solved the problem.
I had similar issue. Fix consisted for me in selecting: "COPY FILES IF NECESSARY" when manually adding the different frameworks into XCode framework.
I dragged the framework to the Framework folder inside xcode, chose to copy files if needed and all worked fine without any other configuration change.
I have installed react-native-fbsdk and link using react-native-link react-native-fbsdk.
Follow instruction of following link
https://developers.facebook.com/docs/react-native/configure-ios
This provide to link react-native library using ios_setup.js There are following step which i have followed.
Setup on facebook developer account.
Install the file ios_setup.js by executing the following command in
a command prompt at your project's root folder.
curl -O https://raw.githubusercontent.com/facebook/react-native-fbsdk/master/bin/ios_setup.js
Install the plist package, the xcode package, and the adm-zip package, by executing the following command.
npm install plist xcode adm-zip
Run the script ios_setup.js by executing the following command, and insert your app's App ID and App Name. If the name of your app is more than one word long, then enclose it between quotation marks.
node ios_setup.js [App ID] [App Name]
When run node ios_setup.js it wll automatically link all files in ios.
After troubleshooting using several answers here. This is what I did.
I changed ~/Documents/FacebookSDK to "$(HOME)/Documents/FacebookSDK" note: I used quotes "
I moved "$(HOME)/Documents/FacebookSDK" to the top of the list in header search paths.
Had a same error in FBSDKLoginKit
If you use multiple pod projects
install! 'cocoapods',
:generate_multiple_pod_projects => true
Then you should force cocoapods to put all of FBSDK pods into a same project to make private headers visible
pod 'FBSDKCoreKit', '5.11.0', :project_name => 'FBSDK'
pod 'Bolts', '1.9.0', :project_name => 'FBSDK'
pod 'FBSDKShareKit', '5.11.0', :project_name => 'FBSDK'
pod 'FBSDKLoginKit', '5.11.0', :project_name => 'FBSDK'
Xcode with Facebook and iOS working - Step By Step
After much frustration I got my Iphone game building just fine. Following a combination of Ixgee's solution, and other solutions.
Fixes - FBSDKCoreKit.h not found and other related issues
I'm using Unity and Facebook SDK v11
Unity -> ExternalDependencyManager -> IOS Resolver Settings - make it build to a Xcode project and make sure all the checkboxes are checked.
MacOS -> move project to Mac. In Terminal in the project directory do the ‘sudo chmod +x process_symbols.sh’
2.5 Make sure you have cocoa pods installed. In Terminal type ‘sudo gem install cocoapods’
MacOS->Podfile - the pod file in your project should look like this for Facebook SDK 11
source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
target 'UnityFramework' do
pod 'FBSDKCoreKit', '~> 11.1.0', :modular_headers => true
pod 'FBSDKCoreKit_Basics', '~> 11.1.0'
pod 'FBSDKGamingServicesKit', '~> 11.1.0'
pod 'FBSDKLoginKit', '~> 11.1.0'
pod 'FBSDKShareKit', '~> 11.1.0'
end
target 'Unity-iPhone' do
end
use_frameworks! :linkage => :static
use_frameworks!
[Only needs to be done once. If your Mac processor uses an ARM processor (like the M1)]] Terminal -> Type ‘sudo arch -x86_64 gem install ffi’
Solution from - https://github.com/CocoaPods/CocoaPods/issues/10723 [super helpful!]
[If your Mac processor uses an ARM processor (like the M1)] Terminal -> ‘arch -x86_64 pod install’
Or
[If your Mac processor uses an x86 processor (like an Intel)] Terminal -> ‘pod install’
Once the Pod Install is successful, double click the newly created ‘Unity-iPhone.xcworkspace’ in your project directory to open the workspace in Xcode.
Xcode->The folder option -> Unity-IPhone-> under Projects select ‘UnityFramework’-> select ‘Build Phases’ then drag the ‘> Headers’ above the ‘> Compile Sources’
-Full details here (https://forum.unity.com/threads/xcode-version-13-3-13e113-error-cycle-in-dependencies.1268720/)
Xcode -> In the Unity-phone - Build Settings -> Set - ALWAYS EMBED SWIFT STANDARD LIBRARIES: YES
In the UnityFramework - Build Settings -> Set - ALWAYS EMBED SWIFT STANDARD LIBRARIES: NO
Source - Validation Error: Invalid Bundle. The bundle at ... contains disallowed file 'Frameworks'
VOILA! It builds to your iPhone with Facebook SDK Dependencies good to go on iOS!!!
->Builds Configuration.
-> Framework Search paths.
put the FacebookSDK directory in my case
~/Documents/FacebookSDK in :
Debugging,
Any architecture I Any Sdk,
Release.
especially this error because there no path in Any architecture I Any Sdk
in my case
~ / Documents / FacebookSDK
and it should be noted that the FacebookSDK folder must be in Domuments
Example
https://photos.app.goo.gl/5bD4d39a11AalYsx1
Change the /Users/[username]/Documents/FacebookSDK/ directory to Documents/FacebookSDK like so: