seem a bit old question but I have try some solution but did not work. I doubt that is because old Facebook frame work is not working anymore. I have a Objective-C project that use FacebookSDK. I have copied FacebookSDK.framework into project folder and add using target-build phrase - link binary with binaries. I tried to clean and build the project but still got error #import <FacebookSDK/FacebookSDK.h> file not found. Is there any solution for this issue? many thanks? By the way how to check version facebookSDK and see whether I need to migrate to new updated version?
If you are using Cocoapods i would suggest to update your FacebookSDK
to the latest with adding those 3 dependencies :
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
then a Pod Install from terminal to download the frameworks and finally do some changes since the new sdk is different .
Related
I have an objective C iOS app using the Parse SDK.
In the process of moving this app from Parse.com to a self hosted Parse-Server, I need to update the Parse SDK to the latest version. For this update I decided to go with CocoaPods.
This is the first time I touch CocoaPods (after reading and hearing so much good about it).
I found my way, following what I could read here and also based on a few CocoaPods tutorial I quickly viewed.
Having my project "ready", when buiding it I get this error:
#import <ParseUI/ParseUI.h> -----> File not found.
Obviously things have changed place. And I tried a couple of unsuccessful solutions.
So here is my question:
How do I need to change the settings of my project, now that I am using CocoaPods?
In order to use Cocoapods with parse and Parse UI you need to do the following steps:
Create a new file and name it Podfile. This file should be located on your IOS project root folder.
The Podfile should contain at least the following structure if you want to use parse IOS SDK and ParseUI
platform :ios, '8.0'
use_frameworks!
pod 'Parse'
pod 'ParseUI'
# Put more pods in here..
Notice to the platform, you may change it to the minimum version that your app can run on and the use_frameworks! will install all your pod as frameworks and this is mandatory if you like to consume Swift libraries.
Open terminal and navigate to your IOS root directory and enter pod install. This command will install all the pods and dependencies into your project.
After installing you will no longer use the IOS project file from now on you will use a new file which called workspace. The workspace will contain both your project files and the pods project/frameworks files.
Build your project, fix some error (if there are) and run it to make sure that it works as expected .
More CocoaPods commands that you need to know are:
pod update - update all your pods to the latest release or to the release that was mentioned in the Podfile
pod update update specific pod to the latest release or to the release that was mentioned in the Podfile
pod outdated - display out to date pods that are being used inside your project.
In Xcode 8 I'm having trouble importing any Swift 2.3 or 3 framework that was added with Cocoapods into my project.
There is a public umbrella.h file, but for some reason Xcode can't find the framework when I try to #import it.
As an example, create any Objective-C project, use the following Podfile, pod install, and then try the #import. It asks me to update the code to swift 2.3 or 3 even if that code is already Swift 2.3 or Swift 3 code. I've cleaned and tried to rebuild as well.
platform :ios, '8.0'
use_frameworks!
target 'testingFrameworks' do
pod 'SwiftyJSON'
end
Did I miss a step?
I used socketIO and was having the same problem. My solution to this is:
Close project.
Delete pod files, delivered files, pod framework, workspace file (clean up project)
pod install
Reopen workspace, upgrade swift syntax if xcode ask for, build a few times.
You might need to fix something for the new swift.
I am using pod 'AFNetworking', '2.6.0'.
But every time I am getting this error:
Recently I updated my mac gems. After updating gems I am getting this error.
Can you please any one help?
Try
#import "AFNetworking.h"
instead of
#import <AFNetworking/AFNetworking.h>
And, of course, do not forget to check the header paths inside your project properties and check if cocoapods correctly installed 'AFNetworking' project. Try to find AFNetworking.h file inside 'pods' directory.
EDIT
Type, what is writen inside 'header search path'
1.
2. What is placed inside /path/to/app/Pods/Headers/Public/ ?
If you have updated your gems, check version of cocoapods if is version 1.0.0, probably you need to change your Podfile.
ex:
platform :ios, 'IOS_VERSION_HERE'
target 'YOUR_TARGET_HERE' do
pod 'AFNetworking', '2.6.0'
pod ...
pod ..
end
After that in terminal go to you project folder where is the Podfile located and write command:
pod update
After that if you see some warnings try to fix them. The warnings will guide you what to do if is necessary.
Then try to clean your project and Build it again.
IMPORTANT!!!
When you use Pod's you must open YOUR_PROJECT_NAME.xcworkspace instead of YOUR_PROJECT_NAME.xcodeproj
Hope this help.
After updating pod's to (pod 'AFNetworking', '3.0') I was facing same issue.
Replacing
#import "AFNetworking.h"
With
#import AFNetworking;
solved my problem!
Next steps always help me to fix the issue:
Select Pods file in your project.
Open the Build settings for Pods project
Set Build Active Architecture Only to false. Build and Run the project again.
The issue was that I couldn't build and got the error message 'AFCompatibilityMacros.h' file not found
Simply running pod deintegrate and then pod install fixed it. I found the solution in this discussion.
I am integrating 3rd party libraries into my project using cocoapods. Everything was working smoothly but when i try to integrate facebook ios sdk I encounter a very strange issue, my pods project has the following warning:
If i click on it i get the following dialog:
I checked the Headers in the build phases part of the target "Pods-Facebook-iOS-SDK". Every header file is repeating:
When i try to build my project it fails because it is not able to find "FacebookSDK/FacebookSDK.h".
My last option is to just integrate facebook sdk manually and not use cocoapods for it but I dont want to take that route and for the life of me I cannot understand what I am doing wrong. For refrence following is my pod file:
platform :ios, '7.0'
pod 'DTCoreText'
pod 'UIView+AnimationExtensions'
pod 'EZAudio'
pod 'MZTimerLabel'
pod 'AWSAutoScaling'
pod 'AWSCloudWatch'
pod 'AWSCore'
pod 'AWSDynamoDB'
pod 'AWSEC2'
pod 'AWSElasticLoadBalancing'
pod 'AWSKinesis'
pod 'AWSS3'
pod 'AWSSES'
pod 'AWSSNS'
pod 'AWSSQS'
pod 'AWSSimpleDB'
pod 'Facebook-iOS-SDK'
Following is the information regarding my developement environment:
XCode: 6.1
Architectures: armv7, arm64
Base SDK: iOS 8.1
I was having a similar problem. My project previously had not used Cocoapods and I was now attempting to add the Facebook SDK via Cocapods.
Based on #MingLi's comment, I replaced all instances of #import <FacebookSDK/FacebookSDK.h> with #import <FBSDKCoreKit/FBSDKCoreKit.h> and things started working again.
When I compiled in Xcode, it showed me files that need #import <FBSDKLoginKit/FBSDKLoginKit.h> and #import <FBSDKShareKit/FBSDKShareKit.h>
You will also likely have to go through and adjust things that changed between Facebook SDK 3.x and 4.x. For instance, I had to replace [FBSettings setDefaultAppId:123456789] with [FBSDKSettings appId:123456789] and replace [FBAppEvent activateApp] with [FBSDKAppEvents activateApp].
Xcode is sometimes helpful about finding the needed change, if you compile and then click the red dot (in your code) next to each compile error.
It can take a good bit of work to sort through all of the changes, you may have to recompile many times.
If you are having problems figuring out how to replace specific functions/classes when upgrading from SDK 3.x to 4.x, you can refer to Facebook's Change Log:
https://developers.facebook.com/docs/ios/change-log-4.x
You can also find additional information here:
https://developers.facebook.com/docs/ios/getting-started
I'm trying to use Restkit via CocoaPods for my first time, on a brand new project, but I encounter some issues building the project once Restkit is introduced:
I have followed these exact steps:
Created a brand new Xcode project, default options.
Created a podfile with the following contents :
platform :ios, '6.1'
pod 'RestKit/Testing', '~> 0.20.0pre'
pod 'RestKit/Search', '~> 0.20.0pre'
Run pod install then opened the workspace
Updated the prefix file as instructed here.
I'm running these versions, all valid according to the Restkit documentation:
Git git version 1.8.1.2
CocoaPods 0.16.2
Xcode 4.6
Can anyone suggest what I may have done wrong, or what I can do to solve this? Thanks
You have to include the base of Restkit as well. Add
pod 'RestKit', '~> 0.20.0pre'
To your Podfile.
Found a solution described here.
It involves searching the project for #import and replacing it with #import . The project compiles!
//#import <RestKit/RestKit.h>
#import <RestKit/CoreData.h>
In this case the offending file was RKOperationStateMachine