Xcode: Swift Dropbox errors in Alamofire source codes - ios

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

Related

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

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.

Does Facebook SDK support Swift 2.3/3.0?

Ok, I can't figure out what's the catch here. I follow all the instructions to configure my new project using CocoaPods to use Facebook SDK. Once I open generated project workspace, Xcode offers me to convert some source code in Pods project to Swift 2.3 or Swift 3.0.
I tried twice - with converting to Swift 3.0 and converting to Swift 2.3. Neither works and both give me on average ~120 compilation-time errors.
What's the deal here? I can't find anyone with similar problems. They seem to support Swift 2.3, but it doesn't work actually.
Xcode 8.0, Deployment target 8.0, latest FB sdk available through pods - 4.16.1
Facebook version 0.2.0 has support for Swift 3.0. Make sure you do the following before installing the latest version of Facebook SDK:
1: Get the latest version of Cocapods:
gem install cocoapods
(or if the above fails)
sudo gem install cocoapods
2: Update your local specs repo by running:
pod repo update
3: And then update your pod file and run pod update or pod install
pod 'FacebookCore'
pod 'FacebookLogin'
pod 'FacebookShare'
I think your probably missing step 1.

SwiftyJSON supported in Xcode 8 and iOS 10?

I recently upgraded my Swift iOS application from Xcode7 to Xcode8 and deployment platform from iOS 9.3 to iOS 10. My application started breaking with errors like this:
Module file was created by an older version of the compiler: rebuild
'SwiftyJSON' and try again.
I Googled around and found this link on SO Module file was created by an older version of the compiler. Followed the instructions and removed the derived data and rebuilt using carthage update --no-use-binaries command. But the application still fails to build and complains about the error message mentioned above.
Is SwiftyJSON supported by Xcode 8 and iOS 10?
SwiftyJSON now supports Swift 3.
pod 'SwiftyJSON', '3.0.0'
At the time of writing this: no.
But there is a fork of the swift3-branch which is working with the GM seeds.
https://github.com/acegreen/SwiftyJSON
pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'
You will get a lot off error after that please delete your derived data folder. And build it. All works fine
pod 'SwiftyJSON', git: 'https://github.com/BaiduHiDeviOS/SwiftyJSON.git', branch: 'swift3'
I fixed this by removing the named file, e.g. /Users/me/Library/Developer/Xcode/DerivedData/ProjectName-aprzyqkcjkpzgaedatcseafvznfq/Build/Products/Debug-iphonesimulator/Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule
Not positive I'm on the right path, because the file was NOT regenerated, but I appear to be past the problem for now, and on to ordinary Swift3 conversion errors in my own code.

Alamofire won't build in empty Swift project using Cocoapods

I am starting a project by creating a blank Single-View app for Swift. Using Cocoapods, I am adding Alamofire as follows:
platform :ios, "8.0"
use_frameworks!
target 'TestGauge' do
pod 'Alamofire', '~> 3.0'
end
target 'TestGaugeTests' do
end
Then, in Terminal I run pod install
When returning to XCode, the project fails to build with 1000+ errors generated from Alamofire.
I am running XCode from the workspace file and NOT the project file.
XCode version 6.4
Has anyone had this behavior, or can anyone offer a solution? Have I missed a critical step?
Thanks!
Alamofire 3.0 is written in Swift 2.0. Xcode 6.4 does not support Swift 2.0. Change Alamofire version or update your Xcode.

Resources