Search code examples
xcodeswiftcocoapodsalamofire

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

Solution

  • 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.