How to add Alamofire in Xcode 10.1 - ios

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

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 :)

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.

Update Xcode to 10.2 or download the latest Xcode, which support Swift 5.0. Its better to keep updated rather than using latest version of any library to an old Xcode version. From Xcode 10.2 it support Swift 5

Related

Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler (couchbaselite) xcode 11.2

I am using couchbaselite enterprise in my project.
After I upgraded XCODE from 10.3 to 11.2, I got this error message. (Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler)
my podfile is like this:
# Uncomment the next line to define a global platform for your project
# platform :ios, '11'
target 'Imece' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'SwiftyJSON', '~> 4.2'
pod 'FSCalendar', '~> 2.7.9'
pod 'CouchbaseLite-Swift-Enterprise', '~> 2.6.1'
pod 'Alamofire'
end
I tried below solution bu it did not make any difference.
in XCODE change
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler
I also tried build the (couchbaselite) framework files as mentioned here https://github.com/couchbase/couchbase-lite-ios#how-to-build-the-framework-files
But I got BUILD_FAILED error.
Is there any other solution to get rid of this situation?
The error means that Couchbaselite framework needs to be built with Xcode 11.2. You cannot change the settings in your app in order to fix it. So your options are to either
Waiting for release of Couchbase Lite that will support Xcode 11.2 or
Downgrade your Xcode version to Xcode 11.1 (the version compatible with Couchbase Lite 2.6.1). You can download previous version of Xcode from here

Xcode keeps showing:-1: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2.Any solution?

When I install facebook SDK pods into my ios project, It says ":-1: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'FacebookCore')"
I am using swift 4.2
any solution?
Change the podfile swift version like for any pod if you are getting this error
like
Select pods of your project
After then you follow the steps as described in the image and change the swift version for the pod
I am currently using Xcode 10.1. The "Targets" section is in another place of the interface.
Xcode 10.1 screenshot
Beyond that, the Ravi Ojha solution works fine as well.
Follow these steps and change nay required pod version.
The solution for me was to update from xcode 10.0 to 10.3 which supports Swift 5.0

Module compiled with Swift 4.0 cannot be imported in Swift 3.2.2: AudioKit

I have just updated xCode to the latest version, and am getting the error when trying to build.
"Module compiled with Swift 4.0 cannot be imported in Swift 3.2.2: /Users/james/Documents/MyApp/Pods/AudioKit/iOS/AudioKit.framework/Modules/AudioKit.swiftmodule/x86_64.swiftmodule"
It was working before I upgraded the latest xCode.
The error message is telling you that Xcode 9.1 is using Swift 3.2.2, while the Swift framework you're building against was built for Swift 4.0 (using Xcode 9.0). You need to update your frameworks to versions built for the version of Swift that you're using.
First If you update the Xcode the Xcode-> preferences-> LocationsTab and change the command line tolls Xcode version.. Now check here
AudioKitReleases
pod 'AudioKit', '~> 4.0.3'
AudioKit V4.0.3 for Xcode 9.1 Pod version according to your Swift language, and update your AudioKit pod by command pod update AudioKit
If you're using AudioKit with CocoaPods, you can run 'pod install' to pull the Swift 4/Xcode 9.1 ver of AK. Then clean (Shift + CMD + K), and clear the derived data. If still having issues, an Xcode restart should fix that.
Or, you can:
(1) Pull the latest AudioKit
(2) Re-compile the framework:
$ cd AudioKit/Frameworks
$ ./build_frameworks.sh
(3) Delete the Derived Data, Clean (Shift+CMD+K), and Restart Xcode
Best of luck,
Best way to get rid of this is, go to https://github.com/AudioKit/AudioKit/releases
find the version compatible with the Xcode that you are using and change you pod file version.
I was using Xcode 10.1 so I changed my file pod 'AudioKit', '4.5'
it solved my problem.

I converted my project into swift ver 3.0 and also did pod update, but cannot update WDImagePicker pod

Is there any other way that I can update WDImagePicker pod version which is compatible to swift version 3.0?
This project is a swift3 version of WDImagePicker - enter link description here

Xcode: Swift Dropbox errors in Alamofire source codes

I want to use Dropbox API in my iOS project.
I'm doing this instructions:
https://www.dropbox.com/developers/documentation/swift#install
And after pod install, I opened my workspace and see many errors in Alamofire. What am I doing wrong?
I'm using Xcode 7.2.1
When you run pod install for SwiftyDropbox, it pulls in Alamofire via the dependency:
s.dependency "Alamofire", "~> 3.1"
The latest version of Alamofire is currently version 3.3.0. There's some information there under "Upgrade Notes" about how this release will only work in Xcode 7.3, due to Swift 2.2 changes. So, you have two options:
1) Upgrade to Xcode 7.3
2) Revert to an older Alamofire release

Resources