library not found for -lAFNetworking - xcode

I have a project on Bitbucket that builds fine on one machine. I cloned it on another machine, did a pod install, everything installed fine. I open the .xcworkspace and it won't build because of the error in the title of this post.
When the project is deleted from the original machine and cloned there (pods installed, etc.) it builds fine.
I don't don't know what's different about the other machine or what information I can provide here to ask this question.
Here's the contents of my podfile:
# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "7.0"
link_with 'Extender', 'DefinitiveExtender'
pod 'zipzap', '~> 7.0'
pod 'SQKPieProgressView', '~> 1.0'
pod 'AFNetworking', '~> 2.3'
pod 'MBProgressHUD', '~> 0.9'
pod 'Reachability', '~> 3.1'
pod 'HockeySDK', '~> 3.5.7'
pod 'Parse', '~> 1.4'

I ran into the same issue. In my case what was happening was that for some reason libPods wasn't being linked.
Click on the project, go to General, click on your target and then scroll down to Linked Frameworks and Libraries. There I made sure to include libPods.a and then the project built fine. Hope that helps.

Related

FBSDKShareKit.h' file not found xcode unity

im trying to build unity project to ios device
everything was working good before i installed FaceBookSDK
now i always get this error:
i was trying some solutions over the internet including this
none of them helped me
unity 2020.3.18f1
FacebookSDK 11.0.0
any help?
this is an issue occurs when using Facebook SDK above 11.1.0,
all you have to do is downgrade the SDK to 11.1.0,
Open the pod file as notepad or on Xcode and change the pod Script for Facebook SDK
replace this
pod 'FBSDKCoreKit', '~> 11.0'
pod 'FBSDKCoreKit_Basics', '~> 11.0'
pod 'FBSDKGamingServicesKit', '~> 11.0'
pod 'FBSDKLoginKit', '~> 11.0'
pod 'FBSDKShareKit', '~> 11.0'
to this
pod 'FBSDKCoreKit', '~> 11.1.0'
pod 'FBSDKCoreKit_Basics', '~> 11.1.0'
pod 'FBSDKGamingServicesKit', '~> 11.1.0'
pod 'FBSDKLoginKit', '~> 11.1.0'
pod 'FBSDKShareKit', '~> 11.1.0'
finally i fixed it using this
the solution:
1- Open terminal and open project output folder (cd [folder path])
2- I run the code "pod install", it created the xcworkscape file.
3- I open the xcworkspace file in xcode and it works without error on device

Unable to find a specification for '[Any pod libraries]'

I don't know what's wrong with my cocoapods. It always show this error on every pod libraries every time I run pod install. For instance "AFNetworking"
[!] Unable to find a specification for `AFNetworking (~> 3.0)`
I tried the following but nothing help:
pod repo update
sudo rm -fr ~/.cocoapods/repos/master
pod setup
pod install
I tried to update my cocoapods to 1.1.1, Xcode to 8.2 and Mac OS to 10.12.2 but problem remain.
My cocoapods can't even search. It show this error every time I run "pod search AFNetworking"
[!] Unable to find a pod with name, author, summary, or description matching `AFNetworking`
Here is my podfile look like:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
target 'Leader' do
use_frameworks!
pod 'AFNetworking', '~> 3.0'
end
I did try to uninstall and reinstall cocoapods back but nothing help.
Please follow below format in your pod file its working in project.
#Uncomment this line to define a global platform for your project
platform :ios, '8.0'
#Uncomment this line if you're using Swift
use_frameworks!
target 'applicationName' do
pod 'AFNetworking', '~> 3.0'
end
If you find any issue please let me know.

Swift cocoapod install framework (Alamofire) occur Syntax error in xcode

I have some problem in installing some external framework. Therefore, I try it in a blank project but the error are the same and I am not sure where i did wrong.error image
It is a little uncommon. It seems like I did install a wrong version of framework as in it appear 40+ error in code syntax.
Also, the error are from Alamofire,AmazonS3RequestManager and so on.
It is my podfile and I just put pod install in the target file directory
source 'https://github.com/CocoaPods/Specs.git'
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!
target 'test' do
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'AlamofireImage', '~> 2.0'
pod 'Firebase', '>= 2.4.3'
pod 'SwiftValidator', '3.0.1'
pod 'AmazonS3RequestManager', '~> 0.8'
pod 'MBProgressHUD', '~> 0.9.2'
end
The code in your screenshot is for Swift 2.2, so you have to update Xcode to the latest version, Xcode 7.3. Your version is too old.

compilation error: cocoapods xcode test project compilation error, how to remove test project cleanly

The question is how to cleanly remove Test in cocoapods PodFile ?
I'ved just recently updated cocoapods 1.0.0 to my project
I ran "pod init" to generate a sample PodFile then put in my pods.
Whole bunch of error generated by the xcode test project ProjectNameTests
http://imgur.com/fUOF18i
How can I cleanly remove the tests ? Even if comment it out there is other problems like Bridging-Header.h cannot find dependent header.
In my current PodFile for 1.0.0:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target 'ProjectName' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for ProjectName
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
target 'ProjectNameTests' do
inherit! :search_paths
# Pods for testing
end
end
my previous PodFile, no mention for target project or test:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'FBSDKCoreKit', '~> 4.9'
pod 'FBSDKLoginKit', '~> 4.9'
pod 'FBSDKShareKit', '~> 4.9'
pod 'SwiftyJSON', '~> 2.3.1'
pod 'Alamofire', '~> 3.0'
pod 'Google/Analytics', '~> 1.0.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'AWSS3'
The type of errors you'r defining are not because you have a target to the tests in your Podfile. inherit! :search_paths indicates that this target inherits the pods from the target above it.
One thing you might be getting wrong is that the "target 'ProjectName' do" is not regarding your project name but an actual target of your project.
A target can have a different name then your project.
You can also check the official migration guide Migration Guide.

CocoaPod Library + Project in Single Workspace, Separate GIT Repos

I'm trying to wrap my head around this complex setting:
I have two projects and a shared library. The shared library is a cocoapod.
I would like to be able to use a single workspace to develop in. There are some duplicated pod definitions, but I have this working in a single Podfile.
Here's where it gets complicated:
I want each project/library in its own git repo. Each repo must be able to live on its own; have its own Podfile, be tested/deployed via CI, etc.
Another wrench: we are the git-flow branching strategy... The master branch of project A/B must pull the master branch of the library. The develop branch of project A/B must pull the develop branch of the library.
Has anyone figured this out? Am I going about this in an ass-backwards way?
Here is a working root workspace Podfile:
platform :ios, "7.0"
inhibit_all_warnings!
workspace 'Root.xcworkspace'
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
xcodeproj 'ProjectA/ProjectA.xcodeproj'
xcodeproj 'ProjectB/ProjectB.xcodeproj'
target 'SharedLibrary' do
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
end
target 'ProjectA' do
xcodeproj 'ProjectA/ProjectA.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
target 'ProjectB' do
xcodeproj 'ProjectB/ProjectB.xcodeproj'
pod 'AFNetworking', '~> 2.0'
pod 'CocoaLumberjack'
pod 'MagicalRecord', '~> 2.2'
pod 'SharedLibrary', :path => './SharedLibrary/'
end
Here is the shared library's podspec:
Pod::Spec.new do |s|
s.name = "SharedLibrary"
s.version = "0.0.1"
s.platform = :ios, "7.0"
s.source = { :git => "http://not.really.uploaded.anywhere.yet/SharedLibrary.git", :tag => "0.0.1" }
s.source_files = "SharedLibrary", "SharedLibrary/**/*.{h,m}"
s.public_header_files = "SharedLibrary/**/*.h"
s.dependency 'AFNetworking', '~> 2.0'
s.dependency 'CocoaLumberjack'
end
What I did was to define an "exclusive" target for the CocoaPod library. An exclusive target will not link with the rest of the Podfile pods. Basically what you're going to have to do is define your target that points to the Xcode project. Then you need to add the CocoaPod as a dependency using the podspec. Because it's an exclusive target, it won't link with itself. For example,
source 'https://github.com/CocoaPods/Specs.git'
target 'SharedLibrary', :exclusive => true do
xcodeproj 'SharedLibrary/SharedLibrary.xcodeproj'
end
pod 'SharedLibrary', :path => 'SharedLibrary/'
does what you would need it to. The only caveat is that every time you add a public header to the library, you need to run pod update to use it in your project.
Podfile Syntax on Targets

Resources