Swift cocoapod install framework (Alamofire) occur Syntax error in xcode - 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.

Related

Unable to find a specification for `Alamofire (~> 3.5)`

target 'MyApp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for MyApp
pod 'Alamofire', '~> 3.5' end
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
target 'MyAppUITests' do
inherit! :search_paths
# Pods for testing
end
This is the pod file, swift 2.3, Xcode VERSION 7.3.1. I'm trying to install alamofire , but I'm getting the error above, i searched google , but there wasn't any useful things to do. any help?
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
target 'MyProject' do
use_frameworks!
# Pods for MyProject
pod 'Alamofire', '~> 4.7'
end
Hopefully this must work. Check for your Pod version also.
First of all try make higher deployment target
if not work then
Try to run these command one by one
pod repo remove master
pod setup
pod update

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.

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.

Alamofire with Xcode 7

I'm using Xcode 7.0 beta 4 (7A165t). I want to add the Alamofire library but it's always failing.
I am using the last Cocoapods version.
My Podfile is:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
Is it possible to use it in Xcode 7 with Swift 2.0?
UPDATE
When I run:
pod install
I get this:
Installing Alamofire (2.0.0-beta.1)
[!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add use_frameworks! to your Podfile or target to opt into using it. The Swift Pod being used is: Alamofire
Do what the error message tells you to and add use_frameworks! to your Podfile. Here's mine as an example:
source 'https://github.com/CocoaPods/Specs.git'
platform :osx, '10.10'
use_frameworks!
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :branch => 'swift-2.0'
For iOS instead of OS X, replace the platform line with platform :ios, '8.0' or equivalent.
this is how mi CocoaPods file looks and im currently working in swift2.0 in Xcode7 Beta
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'RESTEST' do
pod 'Alamofire', '~> 2.0'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git'
I'm using both SwiftyJSON and Alamofire, if you have any trouble using both libraries we are here to help, Greetings

library not found for -lAFNetworking

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.

Resources