Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add Alamofire in Xcode 10.1

I am getting following error when i compile the application after adding the Alamofire using the CocaPods.

error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'Alamofire')

Podfile: pod 'Alamofire', '~> 5.0.0-beta.5'

I am following link to add Alamofire in my Swift 5 project

Xcode Version: 10.1
like image 556
OOkhan Avatar asked Dec 22 '25 21:12

OOkhan


2 Answers

Swift 5 support for Xcode was added in version 10.2. To use Alamofire with Swift 5 you will need to update your Xcode version. Other suggestion is to downgrade your Alamofire version to 4.8.2 or change Swift version to 4.2 in pod settings.


Good luck :)
like image 142
Tomas Jablonskis Avatar answered Dec 24 '25 09:12

Tomas Jablonskis


Swift 5 version support in XCode 10.2. You can not use the beta version of Alamofire in XCode 10.1. To use Alamofire in XCode 10.1 version you can simply use this

pod 'Alamofire'

instead of

pod 'Alamofire', '~> 5.0.0-beta.5'

Hope this will help.

like image 34
Faysal Ahmed Avatar answered Dec 24 '25 11:12

Faysal Ahmed