I'm building a Firebase app in swift, I installed the cocoa pod correctly then created an Objective-C file so it would make me a bridging header. When I try to import Firebase elsewhere in the app it says no such module found. I tried to build anyway because sometimes the error will go away but it failed.
Should I do something with my build settings? I've created bridging headers before and never had too (I thought Xcode did that automatically). I'm using version 7.2.1 (the latest) by the way.
Thanks for the help!
#ifndef FirebaseNetwork_Bridging_Header_h
#define FirebaseNetwork_Bridging_Header_h
#import <Firebase/Firebase.h>
#endif
The documentation from firebase says to use import Firebase when in swift. This however causes errors at compile time. After adding the bridging header and importing Firebase.h inside of it, you will be able to access the Firebase api in your swift files.
Make sure to insert the following line in your Podfile:
use_frameworks!
Then open the .xcworkspace file. Clean the build. Compile it.
Related
I imported the Spotify SDK,
I put the name of the bridging file in the bridging header in the project build settings
The Obj-C compaitibilty header is enabled at TARGET level
I have tried using and "Spotify" on the imports in the bridging file
My bridging file is in the root director
Anyone have a guess as to what I am doing wrong?
I want to import this file so I can get back to developing. Maybe there is a setting somewhere I am missing?
As per the Spotify documentation, you should be using
#import <SpotifyiOS/SpotifyiOS.h>
in your bridging header.
Just go through the Spotify documentation once again, validate everything is as it should be and see if that helps.
I'm trying to integrate my project from Google Analytics to Firebase Analytics. I was using Google Analytics SDK installed with Cococapods. After I do below steps;
Remove 'GoogleAnalytics' from Pod file
Run 'pod install'
Remove bridging header file from the project
Remove bridging header from build settings
I got build error with like average 300 error. Like
Value of type 'CATransition' has no member 'fadeTransition'
I can successfully build when not uninstall Google Analytics SDK so there is no problem with my code. What can cause this problem?
EDIT: I found that deleting bridging header causes the problem, not the Google Analytics SDK.
I found that most of my classes doesn't have import UIKit and somehow, when project has objective-c header, It doesn't need it. However, after I delete it, all of these classes need it. Therefore, implementing
import UIKit
fixed my problem.
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.
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
I thought about using a bridging header, but I keep getting fail to import bridging header. Is it possible for watch extension (written in swift) to use code from the iOS App (written in Objective C)? I need to make sure I am doing this correctly and professionally. If I can use bridging header, why am I getting the following error?
:0: error: failed to import bridging header
It might something as simple as a path problem. But what I normally do is create a dummy Objective-C file so that Xcode will create that bridging header for me, then I just copy and paste the path into the extension's build settings.
I've included a demo project which calls a method from an Objective-C file that is imported in the bridging header. I've also had to add the file in the extension's build phases for it to work. I hope this is what you're looking to solve.
https://dl.dropboxusercontent.com/u/5296996/WKTest.zip