Alamofire and cocoapods - xcode

I'm trying to get my code to link on OS 10.10.3 and XCode 6.3 with Alamofire. My podfile looks like this:
platform :osx, '10.10'
use_frameworks!
target 'worth2' do
pod 'Alamofire', '~> 1.2'
pod 'SwiftyJSON', '~> 2.2'
end
When I go to build my project though, I end up with
dyld: Library not loaded:
#rpath/Alamofire.framework/Versions/A/Alamofire Referenced from:
~/Library/Developer/Xcode/DerivedData/worth2-bskxhwsefwbntgeikvunyfjphixk/Build/Products/Debug/[project-name]
Reason: image not found
I've looked at what sounds like the same issue but it seems like that's for an older version of XCode. Under Targets -> Build Phases -> Target Dependencies, I'm unable to add the frameworks. Apple frameworks show up but not my two libraries.

I think you missed setting the source to cocoapods specs.
source 'https://github.com/CocoaPods/Specs.git'

Related

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.

SwiftyDropbox installation with CocoaPods - Dependency not used in concrete target

Xcode Version 7.3 (7D175)
SwiftyDropbox 3.0.0
I am following the installation instructions on https://www.dropbox.com/developers/documentation/swift#install
Installed CocoaPods via
$sudo gem install cocoapods
Not used Cocoapods before so run:
$pod setup
Created "Podfile" in project directory and added the following text to the Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyDropbox'
Closed xcode, navigated to project directory and executed install
$pod install
Result
`[!] The dependency SwiftyDropbox is not used in any concrete target.`
Any suggestions, this is my first time using CocoaPods, which seems to be a pretty useful library.
Suspect this is something to do with CocoaPods not SwiftyDropbox. Thanks.
Within the Podfile the following needs to be included.
platform :ios, '8.0'
use_frameworks!
target 'foo' do
pod 'SwiftyDropbox'
end

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.

Can't get cocoapods to work with Xcode 7.2 beta (7C46t)

Getting this error
ld: framework not found Alamofire
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I'm trying cocoapods for the first time this morning.
sudo gem install cocoapods
pod setup
My Podfile looks like this:
xcodeproj '/Users/adamek/Development/xCode/Swift_2015/Foody16/Foody16.xcodeproj'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftyDropbox', :git => 'git#github.com:dropbox/SwiftyDropbox.git', :tag => '0.5'
pod install returns this:
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Using Alamofire (2.0.2)
Using SwiftyDropbox (0.5)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.
That part looks good, but I get the following when I try to build my app.
ld: framework not found Alamofire
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've also tried pod repo remove master --verbose and then pod install again, still no luck. Any suggestions?
Your podfile is not right. I am suggesting you some steps. Carefully follow them
sudo gem install cocoapods.
pod init
open Xcode -a podfile
Your podfile should look like this:
use_frameworks!
platform :ios, ‘8.0’
pod 'SwiftyDropbox'
pod 'Alamofire'
Save the podfile
remove all the local dependencies mentioned in your podfile from target folder.
change to #import <Alamofir/Alamofir.h>
use $inherited in your linker Search Path, Build Settings.
Now do pod install, and then pod update.
these steps should resolve your problem. if any other error comes, Comment on this post.

LIbrary not loaded - Reason: Incompatible library version

I just did pod install of an older project (ObjC based) to latest CocoaLumberjack. In simulator everything works, but on device (running iOS 9.1) I get this error:
dyld: Library not loaded: #rpath/CocoaLumberjack.framework/CocoaLumberjack
Referenced from: /var/mobile/Containers/Bundle/Application/69959D96-CAE9-455F-8F74-62A937531E1F/Go 5k.app/Go 5k
Reason: Incompatible library version: Go 5k requires version 2.0.0 or later, but CocoaLumberjack provides version 1.0.0
Any ideas..?
This is my podfile:
use_frameworks!
def shared_ios_pods
# utility
pod 'CocoaLumberjack'
pod 'UICollectionView+NSFetchedResultsController'
pod 'UITableView+NSFetchedResultsController'
pod 'PureLayout'
pod 'UIColor-Utilities'
pod 'KZPropertyMapper', '~> 2.5'
# UI stuff
pod 'M13ProgressSuite'
pod 'JBChartView'
pod 'SAMGradientView'
# Integrations
pod 'YTVimeoExtractor'
pod 'Mixpanel'
pod 'HockeySDK', '~> 3.7'
end
target 'Go 5k' do
platform :ios, '9.0'
shared_ios_pods
end
target 'Go5k watchOS2 Extension' do
platform :watchos, '2.0'
pod 'CocoaLumberjack'
end
This is in Objective-C project and this particular version of CL is I believe Swift based. Not really sure is it relevant.
Fixed by the most unusual way: full clean build + Xcode restart. Jolly wonderful.

Resources