Related
Using Xcode 7
I am trying to install Alamofire in a sample project. Have used the instructions from Ray Wenderlich's page
Only change from above link is the podfile -- which is from GitHub page here because the version has been updated. I have also used the Swift 2.0 branch.
Below is the snapshop of the error, my pod file and my terminal post installing the pod
PODFILE
TERMINAL
P.S: I want to use cocoapods to install Alamofire. I don't want to download it from github page
The Trick for me was to open the .xcworkspace file rather then the original project file itself.
working this:
Scheme -> Manage Schemes...
checked Alamofire checkbox → Build Alamofire scheme
and, if you used Playground , you should change settings Playground:
View -> Utilities -> Show File Inspector
Platform OSX → iOS
Try this one.
For Swift 2.0 there is no need to add Alamofire.xcodeproj into your xcode. Simply copy and paste source folder from https://github.com/Alamofire and you are done.
or if you want to install Alamofire from Cocoapods then try below code.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 2.0'
import Alamofire after importing UIKit
Then comment it out, build the project first.
Uncomment it.
(this worked for me, and others, when the other answers did not).
For reference to anyone who comes across this problem in the future:
Swift 2.x + CocoaPods 1.x
Symptoms: build works in Xcode for debug configuration but fails when xcodebuild is executed from console using pod lib lint or similar command. The result is error: no such module 'X'
Solution:
In MyProject.podspec add your dependencies without specifying versions:
spec.dependency "Alamofire"
The Podfile should also contain the same dependencies. Then run:
$ pod install && open MyProject.xcworkspace
You should open .xcworkspace instead of .xcodeproj. The build will now work in both Xcode and console and pod lib lint passes validation.
I wrote this because I was trying to publish a new CocoaPods pod library and had a similar issue but found no answer and also because Google leads to this question.
Here is what to do:
close your project,
install your pod library,
then install alamofire.
After you do all things, don't open the file with extension .xcodeproj but open the file with extension .xcworkspace
My problem was solved using these steps :
Clean Project
Goto Project > Build Setting > Framework Search Path
and add
"$PODS_CONFIGURATION_BUILD_DIR/Alamofire" as non-recursive
$(inherited) as non-recursive
$(SRCROOT) as recursive
Adding Alamo Fire to all of my target's build phases fixed it for me.
There is only one way to solve this issue.
Quit Xcode.
Delete project's temp files located at
/Users/username/Library/Developer/Xcode/DerivedData
Delete ProjectName.xcworkspace
Delete Podfile.lock file and Pods folder Run pod install.
Open the newly created ProjectName.xcworkspace file and build.
credits to Dimitris Bouzikas here
Have been facing the same problem, following trick resolved the issue
Go to Manage scheme -> Select pod library that is causing issue -> Build
Change back the scheme to project and then run the app, you are good to go
Note: If you don't see the pod library in the scheme, go to Manage scheme and select the pod library that you would like to build.
After doing #satoshin answer, I also had to check the Shared box on the right hand side of the Manage Schemes window.
go to finder locate the project and navigate to the '.xcworkspace' file. thats where your pods are installed. if you go to your original project '.xcodeproj' you will only the pod debug files. hopes this helps. took me a while to figure out the problem too.
I am using swift 3, I fixed this problem by deleting Derived Data for this project.
Cheers...!!!
If clean project/restart xcode/reinstall cocoapods etc, did not work. You can try running Product -> Build for -> Testing (cmd + shift + u). The build failed but the import worked right after.
As for me worked to change the name of the project. Accidentally put
ProjectNameTests
instead of
ProjectName
No schemas needed if you've configured the names correctly everywhere:
Check Podfile
Check which project file you've launched.
(The white icon should be created for "xcworkspace")
Product -> Clean Build Folder
Product -> Build (Now you can run in a simulator).
Start from the scratch, because most of the errors always occur in a cause of humanity mistake, not developers.
If you've put the wrong name for project in Podfile check "Linked Frameworks...". If so - delete this framework. The path is showed below at screenshot.
Example of correct Podfile (Alamofire):
'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target 'ProjectName' do
pod 'Alamofire', '~> 4.7'
end
ProjectName should not contain any extensions(file types).
[For future seekers] you could have missed the second step from the below :
Go to Project Setting
Go to Build Phase tab, create a new run script phase and add an input file to your Alamofire framework. In my case I set $(SRCROOT)/Carthage/Build/IOS/Alamofire.framework
Go to General tab, scroll down to linked framework and libraries add Alamofire.Framework folder. You probably won't find it from list so you need to press "Add Other" button and introduce it yourself.
For absolute newbie just close xcode project and open by the new way.
Choose in your folder file which contains extension like this: .xcodeproj and just enjoy you life.
For me, solution was to exclude arm64 devices from Pods and Project.
Image is in attachment.
You can start by making sure you open the Xcode workspace file (with the extension .xcworkspace) instead of the project file (with the extension .xcodeproj). The workspace file contains dependencies installed by CocoaPods, and it is necessary to use it to work on your project.
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 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:
Recently I tried to update admob SDK(iOS) to the latest version(7.0.0)
I have trouble importing the framework.
It keeps giving me this error "GoogleMobileAds/GoogleMobileAds.h" file not found
I removed the old admob sdk and imported the framework manually.
I've tried
restart xcode
cleaning the project (command + shift + k)
remove the framework and add it again
No luck, any ideas to solve this? thanks.
Answer is to change the 'Framework Search Paths' build setting to the folder where your 'GoogleMobileAds.framework' is located.
Full steps I did to solve:
Remove references to the framework from project navigator
Click on your project in the project navigator, then on your project under 'TARGETS', then click 'Build Phases'
Expand 'Link Binary With Libraries'
Select 'GoogleMobileAds.framework' and click the '-' (if it's there)
Click the '+'
Click 'Add Other...', find and select 'GoogleMobileAds.framework' and click 'Open'
The google ads framework should now be in the list
Click 'Build Settings'
Change 'Framework Search Paths' to the folder where your 'GoogleMobileAds.framework' is located
Clean and re-build project
Right click on framework --> show in finder --> Delete framework from that place.--> go to the project and see at your framework place , its in red color .
Again right click on that and delete it. Again run project and save project . i know the build not successful.
Again add the framework and then run before that clean your project.
In Xcode Settings, change below settings
Enable Modules (C and Objective-C) YES
don't drag framework in your project..
just only copy past in your project folder and add files TO in your project..
i think it's 100% working.
This is the Solution
#1 Open Terminal install Cocoapods -> $ sudo gem install cocoapods
#2 Open Terminal and Enter Path of Your Directory -> cd desktop/gamebuild
#3 Enter this on Terminal -> Pod Init
#4 Go To Directory Paste This Line in Podfile -> pod 'Google-Mobile-Ads-SDK'
#5 Close File and Enter this on Terminal-> Pod install
After a days of web scraping i found a solution..You can follow the guide on the google ad mob official page.I have added the link...
https://developers.google.com/admob/ios/quick-start#cocoapods
After several tries, I've finally managed to build my app (from a Unity project).
It took several steps from different answers here, so I'm posting the detailed steps of what I did.
(I also want to practice formatting skills here in SO. lol)
Overview:
The goal is to install admob cocoapod then set the FrameWork paths.
Yes, these have already been mentioned above but they come from different answers which was a bit confusing for me.
Steps:
Close Xcode if you have it running.
Open a Terminal window and enter the following:
sudo gem install cocoapods
This will install cocoapods
In the same Terminal, cd to your Xcode project directory:
cd Documents/MyGitHub/MyNiceApp
Enter the following:
pod init
This will create a pod file in the project directory
Open the pod file in a text editor and do the following:
Uncomment the line for the platform (update the values if necessary)
In the section for Pods, add pod 'Google-Mobile-Ads-SDK', '7.26.0'
You can specify a version or leave it out to get the latest, like this: pod 'Google-Mobile-Ads-SDK'
The File should look something like this:
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'MyNiceApp-iPhone' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyNiceApp-iPhone
pod 'Google-Mobile-Ads-SDK', '7.26.0'
target 'MyNiceApp-iPhone Tests' do
inherit! :search_paths
# Pods for testing
end
end
Back in the Terminal window where you cd'ed to your Xcode project, enter the following:
pod install --repo-update
This will install the admob framework and save it in your Xcode project directory
Open Xcode with your project or workspace
In Project Explorer, look for Pods > ... > GoogleMobileAds.framework
Copy the Full Path from the properties, it would look something like this:
/Users/mickeymicks/Documents/MyGitHub/MyNiceApp/Pods/Google-Mobile-Ads-SDK/Frameworks/frameworks/GoogleMobileAds.framework
Note: the path contains the "GoogleMobileAds.framework" at the end
Open Build Settings for your TARGETS
Look for Framework Search Paths, double-click then add a new row for it.
Paste the path you just copied.
Clean the project then Build.
I recently had the same error. It was fixed really easy: I needed to open the .xcworkspace file instead of .xcodeproj.
Also did install pods beforehand but not sure if it contributes to the solution :)
Looks like they have some specific dependences and must be added to folder where is located .xcodeproj
this is actual for modul import and without pods: #import GoogleMobileAds;
I have tried to put the GoogleMobileAds.framework\Versions\A\Headersfolder to GoogleMobileAds.framework folder and it worked for me.
Note:
You must delete Header file first. It's already here in GoogleMobileAds.framework folder.
And useGoogleMobileAds.framework\Versions\A\GoogleMobileAds replace GoogleMobileAds.framework\GoogleMobileAds
I am manually dragging the AdMob SDK into my project and was getting this error. Ultimately what worked was I dragged the SDK files into my projects folder on the computer (for me it was: Users/aaronfrom/documents/projectname) when asked to replace files I said yes. It then worked. I think that this is where my framework search path was directed towares and I needed to update the files in the project folder on my computer, it had nothing to do with settings in Xcode.
Check that you have google_mobile_ads.framework in the Frameworks section in the General tab of your project target settings.
If not add the framework with the '+' button. It works for my case
This worked for me:
#import <GoogleMobileAds/GADInterstitialDelegate.h>
I follow the instructions to the T. Fresh install of all, yet getting the error:
"No Such module Alamofire"
Directions here:
In the meantime, you can simply add Alamofire as a git submodule, drag the Alamofire.xcodeproj file into your Xcode project, and add the framework product as a dependency for your application target.
And my screenshots
Make sure you haven't added any files from Alamofire to your project except for the Alamofire.xcodeproj
Here is step by step instruction:
Download and unarchive Alamofire
Copy the root folder of Alamofire to any subfolder of your project. Libs, for example.
Drag and drop Alamofire.xcodeproj to your Xcode project
Open project settings of your project, Build Phases pane, expand Target Dependencies section, and add Alamofire as new dependency
Open General pane, expand Embedded Binaries section, and add Alamofire.framework
import Alamofire // in your source file
Alamofire.request(.GET, "http://httpbin.org/get") // use Alamofire
You need to add the lib to 'the Link Binary With Libraries' section also.
The target Dependencies makes sure your lib is (re)-build before your target (useful when you makes changes to the lib) and the Link section makes sure the lib is available doing the link phase.
EDIT
The above description works for most projects. However alarmofire just updated the process needed for this particular project here https://github.com/Alamofire/Alamofire
Banged my head against this for a couple days and figured I would throw this in here, our team project had this issue when bringing Alamofire in as a submodule. If you have your own scheme configurations, you need to duplicate them in the Alamofire.xcodeproj too. Which also likely means you need to fork Alamofire to keep these changes synced up.
This order of the Build Phases has worked for me.
Target Dependencies
Link Binary With Libraries.
Check Pods Manifest.lock
Embed Pods Frameworks
Compile Sources
You can rearrange Build Phases by dragging them.
After following NAlexN steps, it still didn't work for me
I also had to change the order of Build Phases.
It was
- Target Dependencies
- Compile Sources
- Link Binary With Libraries.
After I modified to:
- Target Dependencies
- Link Binary With Libraries.
- Compile Sources
It built and ran fine!
I resolved the error "No such module" for a fresh project, not for Alamofire but for another library called "RATreeView"
I had to add
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
pod "RATreeView", "~> 2.1.0"
to the Podfile
and ran
pod update
The key is to add use_frameworks! It might help someone
Similar errors when I used cocoapods..
I solved the problem by the following steps:
Update to Ruby 2.2.0+. (https://stackoverflow.com/a/14182172/1453505)
Update cocoapods 0.36.0+ (sudo gem install cocoapods --pre)
Again pod install
Open your project's .workspace file
Open "Manage Schemes" of your project in Xcode
Select "Alamofire" in scheme list
Clean your project
What worked for me: Including "Pods.framework" in "Linked Frameworks and Libraries" of your target if it not there already. (This applies in case you are are using cocoapods and are using frameworks as modules)
I had same issue,doing that Command+B (Build project) and disappear error.
Go to your project folder to be sure you are opening the .xcworkspace instead of the .xcodeproj file