ReactiveCocoa: Xcode asking me the conversion to swift 3 - ios

Evening, I'm working with a project using cocoapods, especially with the SimpleAuth pod.
Now I can't understand why, after I installed my pods and updated them, opening the workspace I receive the warning:
While the readme of ReactiveCocoa is saying that is swift 3 ready.
Mine reactiveCocoa version is 4.2.2, the latest.

You may have to change your Xcode 8.1 toolchain to use Swift 3.0.

Related

Module compiled with Swift 5.2.2 cannot be imported by the Swift 5.3 compiler with xcode 12.1

My project was running perfect with xcode 11.4.1 but when i tried to run project xcode 12.1. I got error "Module compiled with Swift 5.2.2 cannot be imported by the Swift 5.3 compiler with xcode 12.1".
Please see attached image. Thanks!
https://i.stack.imgur.com/39k04.png
I had faced same error in Razorpay integreation in a project. I have down grade my xcode version to the supported swift version and the error gone.
Please suggest any other option, if you found. Some thing which does not require to down grade xcode version and works.
I have fixed this issue via remove Carthage from project and added all those modules which was in Carthage via pod and manual add BuckoNetworking files in the project because BuckoNetworking was not available in pod. Import all module in BuckoNetworking files which needed to that files to run project.

Swift Snapshot for version 4.1

I'm new to iOS development, so thank you in advance for the help. I'm trying to build an application that was built in XCode 9.3 and Swift 4.1. When I install the packages using Carthage, it throws this error:
"Skipped installing CryptoSwift.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.1 (swiftlang-902.0.48 clang-902.0.37.1) and the local version is 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)."
The reason for the error (very clear...) is because I'm trying to build the project using XCode 10.2 and Swift version 5.0.1. So in order to fix it, you need to go to the swifts snapshots and download the version I need and install it.
However, when I go to the swifts snapshots I see the one for 4.1 but the links seem to be broken(?). It redirects me to the apple Xcode documentation.
Does anyone know where and how can I install the swift version I need?
Thanks,
If I understand your problem right, try giving this a go(if not already):
When using a newly released version of Xcode you'll have to build
libraries from source (by passing --no-use-binaries to carthage
update) until a new version of framework comes out which has pre-built
binaries for that Xcode version.
The above is an extract from: https://github.com/realm/realm-cocoa/issues/6134 and it might help...

How to get AWS frameworks working in Xcode 11?

I'm trying to get AWS frameworks working in Xcode(version 11.2.1) by importing them manually. The only way I get them working is by adding them in the Embed Frameworks under Build Phases. Everything is fine until I import AWSMobileClient in one of my swift files. Here things go wrong. If I try to build project on device simulator I get this error:
Could not find module 'AWSMobileClient' for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7
Then I change to physical device and I get this error:
Module compiled with Swift 5.1 cannot be imported by the Swift 5.1.2 compiler: /Users/lukacefarin/Library/Mobile Documents/com~apple~CloudDocs/Projects/InoSupport/AWSMobileClient.framework/Modules/AWSMobileClient.swiftmodule/arm64-apple-ios.swiftmodule
I read about this error on stack overflow and it seems that I can't do much except waiting that AWS will fix that.
Is there any workarounds? All my project frameworks are imported manually so I don't want to use Cocoapods or Carthage.
EDITED on 9 February 2020:
I posted this issue on GitHub and get replay that they are working on the solution. Till then use dependency managers I guess.
I was facing the same problem as you can see, my local swift version is 5.1.3.
"Incompatible Swift version - framework was built with 5.1 (swiftlang-1100.0.270.13 clang-1100.0.33.7) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."
So, I had to look for aws-sdk-ios version compatible with my installed swift version 5.1.3.
Your installed swift version is 5.1.2.
During my tries, I found an aws-sdk-ios version compatible with your local version of swift 5.1.2.
Try to use aws-sdk-ios "2.13.0", my log says that this framework was built with 5.1.2.
*** Checking out aws-sdk-ios at "2.13.0"
*** Downloading aws-sdk-ios.framework binary at "AWS SDK for iOS 2.13.0"
*** Skipped installing aws-sdk-ios.framework binary due to the error:
"Incompatible Swift version - framework was built with 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9) and the local version is 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)."

Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0 compiler

I am trying to implement integration of third party app into project as per instruciton https://github.com/Paytm-Payments/Paytm_iOS_App_Kit/tree/master/Swift/BitCodeDisabled/PaytmNativeSDK
I see the following error in build
Module compiled with Swift 4.2.1 cannot be imported by the Swift 5.0
compiler
I have tried toolchains https://medium.com/xcblog/switching-swift-versions-inside-xcode-using-toolchains-755b28831c43
The error changes to Reason: Incompatible library version: PaytmNativeSDK requires version 1.0.0 or later, but libswiftCore.dylib provides version 0.0.0
How do i setup XCode or the Library to make it work . There is no chance of the vendor updating the library for Swift 5.0 and make it available on POD.
For Carthage users: After upgrading to Xcode 10.2, I ran into this same issue with a framework that I had been importing using Carthage.
I resolved it by rebuilding the framework:
carthage update --no-use-binaries --platform iOS
The correct solution is download Xcode 10.1, and wait for Apple patch the bug fix.
Don't waste time on fix third-party bug.
The problem of my project is we are using Alamofire which is failed to update by Carthage.
The provider of this library should rebuild it with BUILD_LIBRARY_FOR_DISTRIBUTION = YES; (available in Xcode 11.3 in Build Settings -> Build Options). Already asked to do it in the corresponding GitHub issue. After that PaytmNativeSDK will be compatible with every next Swift version.
It looks like the issue has been fixed in 804152caae76245d96548eb74ea87a6150239407.
I wanted to use Swift 4.2 (which Xcode 10.2 should still support, I've set it in Swift Language Version), but it still gave me an error about the Swift 5.0 compiler. So after trying to clear everything like build folder, derived data and stuff, I came to the conclusion that it does not work on Xcode 10.2.
I reverted back to Xcode 10.1 which you can download here. This works. So until Apple fixes this bug I am forced to stay on Xcode 10.1.
The developers of the framework need to provide an update, which is built in Xcode 10.2.
Explanation for framework developers:
Even if you created the framework in Xcode 10.2 or with the default version used by CI, your users may still encounter such an error. You should make sure that Xcode 10.2 is your default command line tool. You can check it in terminal with the command xcodebuild -version.
Default version can be adjusted in Xcode -> Preferences -> Locations -> Command Line Tools.
This will happen if you have external libraries in your project thats still built using 4.2 compiler, whereas the new Xcode tries building your project in 5.0 compiler.
In my case, I had few libraries imported using Carthage. Luckily the libraries that I have used have released an updates in the past few days making it compatible with Swift 5.0 compilers. If those external libraries haven't updated it to support Swift 5.0 you may be out of luck for now.
On the way you might still face few issues and here are some best practices to avoid further issues.
Remove the cartfile.resolved and Carthage folder completely
Ensure you remove any copy of the libraries added to your project earlier.
Remove the embedded libraries and Linked frameworks and libraries from your Targets> Yourapp > General .
Product > Clean build folder
Update the Cart file and fetch the new sources using the Carthage update command
Now import the libraries back to your project.
Hopefully it works.
My problem with Carthage was related to the xcode phase that copys binaries in
"carthage copy-frameworks" phase.
I've a slightly different solution to the one commented in https://stackoverflow.com/a/55362536/721929, because that solution also updates dependencies versions in some cases.
So, I just executed "carthage build". I also include a cache clean for Carthage, to fix possible errors in subtasks (in my case, failing in git clone with "exit code 1")
rm -rf ~/Library/Caches/org.carthage.CarthageKit
carthage build --no-use-binaries --platform iOS --verbose
Just remove all the *.framework folders, fetch and generate then just Import the new framework folders to your project.
That's what helped me.
For Instance:

Module file was created by a newer version of the compiler

I'm taking over development of a project and am unable to contact the previous developer. I'm trying to figure out which versions of the imbedded open source libraries were used. The project appears to be in Swift 2.1. I am attempting to compile it with Xcode 7.3.1. Carthage was the package manager used. I'm stuck on an error with RealmSwift. The error occurs on the line that tries to import RealmSwift.
/{app source path}/PersonnelModel.swift:10:8: Module file was created
by a newer version of the compiler: /{app source
path}/Carthage/Build/iOS/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule
I have worked my way all the way back to version 0.96.2 of realm-cocoa, which I believe is the first version to support Xcode 7.1 and Swift 2.1. However, I'm still getting the error.
I have looked through other answers on here, but have not found a solution that works. Am I misunderstanding the cause of the error? I just thought it was picking up a newer version of the framework.
Here is what my Cartfile looks like:
github "ReactiveCocoa/ReactiveCocoa"
github "Alamofire/Alamofire" ~> 3.4
github "SwiftyJSON/SwiftyJSON"
github "realm/realm-cocoa" == 0.96.2
github "scalessec/Toast-Swift" ~> 1.4.0
If you're just trying to get a clean compile for now, it might be worth taking Realm out of Carthage, installing it manually as a dynamic framework, and then putting it back into Carthage at the end once you've got everything smoothed out.
Xcode 7.3.1 was Swift 2.2. The very latest version of Realm to support Swift 2.2 is version 2.3.0, so I'd recommend downloading that version and manually importing it into Xcode 7.3.1
As an aside, Realm has dropped support for Swift 2 starting with version 2.4.0, so it's greatly recommended you migrate your codebase to Swift 3 as soon as possible. :)
I had this issue today in Xcode 8.3.2 w Swift 3. I mistakenly tried to run the swift 3 converter on one class file and canceled it mid run. Xcode then threw this error for one of my Pods (Bolts). Fix was to remove the pod, run pod update, then add the pod back, run pod update again so the module was reset.

Resources