Related
I did every solution from web search..
As you see the image, GoogleMobileAds.framework is included well.
But I can't build project with 'No such module 'GoogleMobileAds'' error
What should I try?
p.s. what I did additionally
Build Settings
Other Linker Flags : $(OTHER_LDFLAGS) -ObjC
Always Search User Paths : YES
Framework Search Paths : $(inherited)
Add import AppDelegate
import Firebase
p.s. I'm trying to integrate without CocoaPods
You need to make sure the framework is included in your targets Build Phases. Target>Build Phases>Link Binary With Libraries. If it is not there click the "+" sign to add it.
I have faced the exact same issue. Running the following command in Terminal solved it for me:
pod install --repo-update
Actually, you don't need CocoaPods.
Just remove the framework from your project's hierarchy.
Find the GoogleMobileAds.framework file you just unzipped and simply drag and drop it into the navigator (the view on the left that shows you all the files in your project)
Make sure to check "Copy items if needed" and select the "Create groups" option when prompted.
Works like a charm to me.
If installed with "pod 'Google-Mobile-Ads-SDK'", remove it from pod file, run pod install, then add it back, run pod install again. :)
Make sure your Podfile file contains the following libs
pod 'Firebase/Core'
pod 'Firebase/AdMob'
Maybe it helps someone.
I ran into the same issue. I would suggest using the cocoapods. If you want to integrate the SDK manually, copy the framework to the root directory and then move it to the Frameworks folder later. It seemed to resolve my issue.
Open application prefenences and link this framework into your project. check'embedded framworks' and framework path too.
https://developers.google.com/admob/ios/quick-start
read this manual
I find the solution
just add "GoogleMobileAds" to your project holder
then open Build Phases choose Link Binary With Libraries and press + and choose "Add other..." find in your project holder "GoogleMobileAds" and ad it
enter image description here
Remember there are two places to update when you add/replace/move a framework:
Under build phases be sure to add the framework to the list of libraries to link with
For the target (not the project) add the directory containing the framework to the "Framework Search Paths" list of directories if it is not already present (for example, if you placed the framework in a path not previously containing frameworks)
You need to use the xcworkspace file. You are using the regular xcodeproj file:
After I update my Firebase via "pod update", I got error like this :
ld: warning: directory not found for option '-F/Users/bennysantoso/Library/Developer/Xcode/DerivedData/FCM-atfcxuircoryufazlomgwfgmvaqm/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: framework not found GoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here my Podfile :
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'BB' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BB
target 'BBTests' do
inherit! :search_paths
# Pods for testing
end
target 'BBUITests' do
inherit! :search_paths
# Pods for testing
end
end
Does anybody know about this error?
I seek out relationships GoogleToolboxForMac and Firebase, but I just get a little bit of information.
FYI, I use Swift 2.3 and Firebase 3.8.0.
I will be grateful for any help you can provide. Thanks!
I had the same error. Once you install the pods, you'll see the following message.
[!] Please close any current Xcode sessions and use MyApp.xcworkspace
for this project from now on.
I didn't notice this for the first time and was trying to build the project using the regular xcodeproj file. After I saw this message, I opened the right project and it worked fine.
Once you open this project you'll notice that you have two subprojects. One would be your project, and another would be the Pods project.
Framework Not Found
When using Pods, we usually face this issue.
There are two main reasons for this
When we open the .xcodeproj file instead of .xcworkspace as mentioned by izaaz-yunus in this Answer
When Build Active Architecture Only is set to Yes in Build Settings
This applies to the projects target and also to all the targets in the pod project
Main Project Screenshot
Pod Project Screenshot
Select Build Settings (of main project, pod project both)
Select each Target one by one
Set Build Active Architectures to No for each target
Finally clean and rebuild your project.
In my case all integration are well-done and also did try so many time to remove and reinstall pod but did not get success.
Finally try with below step
Projetc->Manage Schemes -> Select check box "Pods-MyProjectName"
And get success.
GoogleToolboxForMac is a dependency of Firebase/Messaging. Details in the podspec. When doing "pod update", Cocoapods should set up your workspace to build and link GoogleToolboxForMac.
It sounds like something about your workspace is in a bad state. Does Product -> Clean help? What about deleting Derived Data and the ModuleCache (Xcode -> Preferences -> Locations -> Derived Data)?
It shouldn't be necessary, but you could also try explicitly adding pod 'GoogleToolboxForMac/Logger' to your Podfile.
its work's
1. select your project in directories
2. select General
3. Add "GoogleToolboxForMac.framework" to the Linked "frameworks and Libraries"
This was fixed by adding $(inherited) in the Build Settings -> Search for LIBRARY_SEARCH_PATHS.
This is understandable, since when updating your pod file for the latest versions of libraries which your project depends on, the debug output tells you where you need to add all the $(inherited) flags:
LIBRARY_SEARCH_PATHS
OTHER_LD_FLAGS
GCC_PREPROCESSOR_DEFINITIONS
Go to : target -> Build Settings -> Other Linker Flags -> remove framework "GoogleToolboxforMAC" and build the project.
I had the same issue when I tried to run it on my device. On the simulator it was working fine. I tried some of the above but it didn't work for me. I checked that I was working on .xcworkspace instead of .xcodeproj file, so I tried this one. Follow these steps to:
Open Xcode project (cocoapods project) using .xc... file.
Select Pods project in the project navigator (blue icon on left).
Under Targets, ensure Pods-ProjectName (blue icon) is selected.
Navigate to Build Settings and set the iOS Deployment Target on which iOS version you are going to run project.
Note:It is same as what you set in Project->Targets->Deployment info->Deployment Target.
Maybe someone get benefitted from this.
If you're facing the same error, in your XCode, go to:
Your Project > your target > Scroll down to Linked Framework and Libraries and check if the Library entry is dimmed:
If so, remove and add it again. In my case, I had duplicated entries and one of them was dimmed (when XCode can't find them on disk).
Closed the project that I was trying to build after I did pod install then opened the .workspace and then everything builds perfectly.
Open the your-project.xcworkspace in your project destination.
1)Open terminal -> 2) $cd /project_destination -> 3) $open your-project.xcworkspace
or just open the file in finder
Make sure your "Build Active Architecture settings" for both your project target and the pod are same. Setting NO in both these cases fixed my issue.
My issue was that I had a /bin/sh script that copied specific Pods which didn't exist. This was one of them. Removing the script resolved the build issue.
-I search in harddrive for the GoogleToolboxForMac files, found in :
/Users/Marco/Documents/iosapps/BomRetiro/Bom Retiro/Pods/Target Support Files
And then i copied the files to this folder :
/Users/YourHomeFolder/Library/Developer/Xcode/DerivedData/Bom_Retiro-bsfjbazzzuwmuidqurdmjvdtnnsb/Build/Products
And then for me is resolved opening the project usinf .xcworkspace file.
For those still having issues after all this.
I am working on a cordova project and the issue suddenly appeared after upgrading to XCode 11.5.
Finally I was able to solve it by opening the pods.json file in the project root and remove the entry in "libraries" which belongs to "FirebaseMessaging".
We were not using that and I dont know how it got there.
Additionally I have changed the "Build Setting" -> "Build Active Architecture Only" to "No" everywhere.
Afterwards I opened the .xcworkspace file again and the build ran through.
Worked solution is
Search GoogleToolboxForMa in xcodeproj
Remove all references from the build configurations
Swift 5 Simple Answer
Shift+Alt+Cmd+K //Clean the project and Run again!
//if not work restart Xcode and again clean it
//Its will work happy coding
Friends, you must be confused with the exact result, as i was. So, i feel to share the
screenshot that might be helpful. We all had to be careful that we need to change the flag for property **"Build Active architecture Only"** for **pod target** to **NO** And build, it would not show the linking error.
See the attached screenshot.
Screen Shot 1, Screen Shot 2, Screen Shot 3
[Select Pods][1]
[Select Targets in the pod][2]
[Change flag to No][3]
[1]: https://i.stack.imgur.com/E7mjX.png
[2]: https://i.stack.imgur.com/wCwET.png
[3]: https://i.stack.imgur.com/KVGKM.png
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: