'FBSDKLoginKit/FBSDKLoginKit.h' file not found (Facebook SDK for iOS v4.2 & Xcode 7) - ios

I follow all the steps in This Tutorial and/or Facebook SDK Documentation to install Facebook Login on my App, but when I run the code I get an error. although Facebook mention I can just use import (Swift) to include the framework, I try to do it the old fashion as well with Objective-C Bridge Header.
Error:
'FBSDKLoginKit/FBSDKLoginKit.h' file not found
ScreenshotAs you can see the bridge.h is being read by the compiler, but due to internal file error it will throw error.
Bridge.h In Xcode 6 you don't require bridge header file, I could just do it with import
#import <FBSDKLoginKit/FBSDKLoginKit.h>
This problem is due to Xcode 7 Beta, I have tried to do it on Xcode 6 and it worked perfectly with just an import FBSDKLoginKit. Can anyone tell me a hack around this? or if there is a way to convert my Swift 2 code back to 1.4 and work on Xcode 6.

I had the same problem.
Managed to sort the directory by adding the Facebook SDK in "Framework Search Path".
Target -> Build Settings -> Framework Search Paths -> + /Users//Documents/FacebookSDK
it works!
=]

For those using cocoapods the solution for me was actually adding FBSDKCoreKit to podfile:
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
The facebook documentation is incomplete, they dont mention anything about including FBSDKCoreKit pod reference.

For [login,sharekit,corekit].h file not found error , My solution was:
changing framework searchpath of RCTFBSDK (inside library of the project)
~/Documents/FacebookSDK
to
$(HOME)/Documents/FacebookSDK

I have the same issue and recognized, that my old XCode 6 projects worked with the Facebook frameworks.
So i try the following workaround and that fixed the problem. however i don't know why:
Facebook iOS SDK 4.2
Create a fresh project in XCode 6
Link the Facebook Frameworks to your project as described in the docs
Close the project and reopen it in XCode 7
The "To Swift 2 Converter" should open within the project - Convert the project to Swift 2
Run the project - in my case everything works fine.
After that i copied my "old" Swift 2 Files into the new project. The app starts without any issues.
I observed the changes by the converter, but can't recognized any change depending the Facebook frameworks.

Had the same issue, instead of updating the search path
I solved it by removing the Frameworks from the project and then adding them checking the Copy items if needed box
My header files looks this
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>

You can simply put ~/Documents/FacebookSDK in Framework Search Paths and it will work for any user

this is a known bug: https://developers.facebook.com/bugs/362995353893156/
Check out this solution: Facebook iOS8 SDK build module error for FBSDKCoreKit

Related

Xcode compile error with Firebase

I just installed the Firebase framework to Xcode (not using CocoaPods due to other unsolvable issues with that). I followed the Firebase Alternative Setup instructions from here (manually dragging the FireBase 2.5 Framework to my project).
Problem is, when I compile my app I get 27 errors:
screenshot
I'm just using the sample code from the Getting Started page.
In fact, all I'm using so far is the first line, but it won't even instantiate that. (var ref = Firebase(url:"my firebase URL here")
I'm on Xcode 7.2 and Swift 2.1. My target is iOS 9.2 using the Simulator.
Please help!
Thanks.
PS.
I should also add that libicucore.dylib and libc++.dylib no longer appear to be available as linkable libraries that you mention to include from firebase.com/docs/ios/alternate-setup.html So maybe this is related? Someone mentioned libz.tbd is the one to use now? (which I'm using)
If you are targeting 9.2 then the frameworks changed to the following:
libicucore.dylib to libicucore.tbd
libc++.dylib to libc++.tbd
They are exactly the same so use them instead, you have to use them in order to get it working.
A comment by apple:
For those who are curious, the .tbd files are new "text-based stub
libraries", that provide a much more compact version of the stub
libraries for use in the SDK, and help to significantly reduce its
download size.

No such module FBSDKCoreKit error

I am trying to add the Facebook SDK to my iOS 9.0 Swift app in Xcode. I did the install according to the FB-dev instructions. However, when I add the header to my AppDelegate.m file import FBSDKCoreKit I keep getting a message saying "No such module 'FBSDKCoreKit'" error .
Based on what I read elsewhere
I have already cleaned the build and re-installed Xcode and updated
my OS X
I have double checked the plist and the framework files FB lists in
the instructions, but nothing has seemed missing.
I have set the "Allow Non-modular Includes in Framework modules"
setting to YES in Build settings.
Nothing seems to work. I do not know where to go from here and have done hours of research trying to find the solution.
When you are importing the frameworks, Make sure you have selected "Copy if needed" . Version after Xcode 6.3 seem to be giving issues if this part is NOT ticked.
I solved 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. It's not what Facebook recommends, but 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 :)
With CocoaPods, swift 2.1, and iOS 9, I tried adding it to the bridge header and it works fine, for example:
#ifndef MY_Bridge_Header_h
#define MY_Bridge_Header_h
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
// ... other imports
#endif /* MY_Bridge_Header_h */
I had errors following alongside the AppCoda tutorial which is not fully up to date. I recommend following Facebooks own instructions. The issue for me was that I had to add the frameworks to my project and then add sdk search path. After that I could import without an error.

Parse API 1.6.4 - cannot build project

I downloaded the new iOS Parse API (1.6.4) and tried to build my project. When I do, I get this error:
Undefined symbols for architecture arm64" "_BFTaskMultipleExceptionsException", referenced from:
___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke214 in Parse(PFObject.o)
___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke311 in Parse(PFObject.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Screenshot:
Temporary workaround for Parse 1.6.4 and Facebook SDK 3.23:
Add to your AppDelegate.m or another class following constant after imports and before implementation section:
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
#interface IPAppDelegate ()
#end
#implementation IPAppDelegate
It should solve the problem until it'll be solved on Parse/Facebook side.
--
Update: This solution is only for Facebook and Parse SDK versions that listed above and these versions right now are outdated.
New Parse SDK 1.7.4 works correct with new Facebook SDK 4.0 and there shouldn't be such a problem.
I was able to figure out the URL for anyone that needs Parse iOS v1.6.3.
https://parse.com/downloads/ios/parse-library/1.6.3
I can confirm that everything compiles properly using 1.6.3.
Placing
NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
in the App Delegate as suggested by Sergey Surkov in between the imports and the implementation and then adding libstdc++.6.dylib in build phases worked for me. Please also view https://stackoverflow.com/a/27628797/1036945
I've had the exact same problem using the latest SDKs from Parse (1.7.4) and Facebook (4.2.0). The problem is caused by the Bolts.framework included in both Parse and Facebook SDKs. For some reason the Bolts framework in Parse is always newer than the one included in the Facebook SDK.
After many-many attempts at installing, removing and re-installing these SDKs, using the drag and drop method and via Cocoapods, I finally managed to overcome this issue by undertaking the following steps:
I removed completely any instance of the Parse, Facebook and Bolts frameworks from my project;
I re-added the FBSDKCoreKit framework (and the ShareKit and LoginKit for the needs of my project) following the steps on the Facebook developer page: https://developers.facebook.com/docs/ios/getting-started/
Make sure NOT to copy the items to your project.
I re-added the Parse framework to the project using the drag-and-drop method. I also added the ParseFacebookUtilsV4 framework because I needed it to create users via Facebook Login.
This was the most important step that solved everything: I added the Bolts.framework provided by Parse by dragging it to the project, but making sure NOT to copy it to the project (just like with the FBSDKCoreKit framework, I deselected the "Copy items into destination group's folder." option. If you copy it to the project folder, the project won't build.
These steps finally solved all my problems.
if you are using cocoapods try pod update Bolts
EDIT2: FacebookSDK Update 3.23.2 resolves this issue and includes Bolts 1.1.4: https://developers.facebook.com/resources/facebook-ios-sdk-3.23.2.pkg
EDIT:
Drop -ObjC "Other Linker Flag" from your Build settings.
Bolts.framework is not necessary with Parse if Facebook SDK is integrated.
As of Facebook iOS SDK 3.14 bolts.framework is included. https://developers.facebook.com/docs/ios/upgrading-3.x
Try removing your manual instance of bolts.framework.
Just to put the record straight.
The issue is caused because of a conflict with the Bolts framework between the Facebook SDK Bolts and the Parse bolts framework. A temporary solution to get around this issue is to use Cocoapods for your Facebook SDK dependency which will help while a fix is worked on.
The bug has been acknowledged by Facebook & is being assigned to the appropriate team for fixing.
Please follow https://developers.facebook.com/bugs/383331175179417/ for the updates.
make sure the facebook sdk framework and bolts framework (comes with fb sdk) is imported into your project.
i got similar error ("...is not a dylib" and "Undefined symbols for architecture") because i dragged the whole parse folder ("parse-library-1.7.4-2") into my xcode project, when i should have dragged only the frameworks i needed ("Bolts.framework" and "Parse.framework"). deleted the parse folder, dragged over the two frameworks, then everything works as expected :)
I had the exact same problem. Updating Bolts to 1.1.4 solved it for me (Bolts was 1.1.3 before).
If you use cocoapods, change or add this line to your podfile
pod 'Bolts', '1.1.4'
If not, just download it here : https://github.com/BoltsFramework/Bolts-iOS/releases
Try downloading the latest SDK and replacing all of the Parse frameworks with the latest version.

Admob SDK - iOS -File not found

I have installed Google Analytics and Google AdMob SDK in my iOS project using Cocoapods. I have implemented both the functionalities in my app and everything looked okay for a week. Then suddenly, when I compiled the app, I received this error message:
"GADBannerView.h file not found". in "#import GADBannerView.h"
But I was able to see the header GADBannerView.h in my project under Pods target.
I did some research and found this error can happen due to SEARCH PATH in BUILD SETTINGS. Many faced similar issues when they moved the project from one machine to another machine but I didn't do that. So, instead of investigating on SEARCH PATH, I removed my GADBanner implementation from my project and commented line #import GADBannerView.h and my project compiled successfully.
I don't quite understand why the Google Analytics SDK is getting compiled successfully while AdMob is throwing a compilation error. I even did a pod update and still received the same error.
The SEARCH PATHS in my target is $(inherited) and ALWAYS SEARCH USER PATH is set to No
Starting at AdMob 7.0, AdMob has made the SDK a framework. Import it like so:
#import <GoogleMobileAds/GoogleMobileAds.h>
Go to: --> Build Settings --> Apple LLVM 7.1 - Language - Modules --> Enable Modules (C and Objective-C) --> set it to Yes.
According to the Google Ads Developer Blog we need to use:
#import GoogleMobileAds;
If you have a problem with the #import syntax you need to modify your project build settings. Search for Modules and set Enable Modules to YES.
First one is issue of latest SDK will not be used for Admob.
second is issue of Xcode 7.0 and you can try in Xcode xcode below 7 for till date,

FacebookSDK and Bolts conflicting each other (duplicate symbols) on build

Not sure what is the problem.. 91 symbols found duplicated for armv7
Am on a Swift project targeting iOS 7.1.
Both frameworks are of the latest versions.
Tried cleaning project and removing derived data., but to no avail.
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._URL in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._appStoreId in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)
duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._appName in:
/Users/rynecheow/Development/THPopQuiz/Frameworks/FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o)
/Users/rynecheow/Development/THPopQuiz/Frameworks/Bolts.framework/Bolts(BFAppLinkTarget.o)
I had the same issue with the 91 duplicates. What worked for me was simply to remove the Bolts.framework which seems to be somehow already included in Facebook new SDK.
Hope it helps!
Had the same issue.
Removing the Bolts.framework was NOT a solution since I get the errors that Leo Flaherty mentioned (comment in the accepted answer).
Using the solution mentioned by iOS_DEV seems like an ugly hack to me.
Using the latest Parse and Facebook SDKs was also NOT a solution (mentioned by Simon Bøgh) since I was using the version 3.x of the Facebook SDK and the latest is 4.x.
The Facebook SDK Change log mentions: The Facebook SDK for iOS v4.0 is a major version upgrade.
Since I needed to meet a deadline, I couldn't dedicate time on re-writing all my Facebook code, to fit with the new 4.x SDK version.
Solution that I propose:
Instead of adding the Bolts.framework and FacebookSDK.framework as framework to your project, add them as Pods:
pod 'Bolts'
pod 'Facebook-iOS-SDK', '3.23.1'
Find here all the Facebook SDK versions available, in case you need to use one which is not the latest.
In case you're using Swift, you need to add the following in your bridging header:
#import <FacebookSDK/FacebookSDK.h>
#import <Bolts/Bolts.h>
This worked for me.
1) I deleted the Bolts.framework that came with parse.
2) Added only parse (selecting copy into destination folder) & facebookSDK (unchecking copy into destination folder). Also checked Framework search path in Build Settings.
3) Added NSString *const BFTaskMultipleExceptionsException = #"BFMultipleExceptionsException";
in AppDelegate.m before
#interface AppDelegate ()
#end
I know an answer has already been accepted, but this has now been resolved by Facebook.
If you download the latest Parse SDK (1.7.0) and Facebook SDK (4.0.0) as of this writing, it should work just fine. Both SDKs were updated just hours ago.
I have imported and copied Bolts.framework and Parse.framework from the Parse SDK, and then linked to Facebooks SDK (now called FBSDKCoreKit.framework), and it successfully builds the project.
Duplicate question: Parse and facebook sdk -duplicate symbol
Follow these step:
applicatonTarget-> Build Phase-> expend Compile sources.
Here, you need to remove those file that causes duplicate symbol error. Then build again.

Resources