Apple Swift-Format tool for Xcode 11.4 - swift

Uses https://github.com/apple/swift-format after update Xcode to version 11.4 start getting error:
"Unable to lint xxxx.swift: SwiftSyntax parser library isn't compatible."
How do we solve that issue? Changing SwiftSyntax version does not help.

Finally, swift-5.2-branch was created https://github.com/apple/swift-format/tree/swift-5.2-branch. The issue was solved by moving the new version of SwiftSyntax parser library.

Related

Swift Version Conflict: this SDK is not supported by the compiler, Please select a toolchain which matches the SDK

I'm using xCode 13.1 with macOS 12.0.1 Monterey. I added KingFisher and removed it from my pod. but my project is not built anymore. I got this error for one of my local SDKs:
Failed to build module 'CbSdk';
this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.4
(swiftlang-1205.0.26.9 clang-1205.0.19.55)', while this compiler is 'Apple Swift version 5.5.1
(swiftlang-1300.0.31.4 clang-1300.0.29.6)'). Please select a toolchain which matches the SDK.
What I've done but didn't work:
pod deintegrate and pod install.
restart xCode with clearing cache and DerivedData.
checkout old branch and commit that worked before.
moving code to another macBook that worked before.
download, install and select toolchain 5.4 (odd errors appeared -> )
changing swift compiler language of my target and project to swift 4 (It says you are using swift 5.5.1 again!)
note that I didn't update xcode or swift!
Taken from this Twitter thread.
You need to set the BUILD_LIBRARY_FOR_DISTRIBUTION build setting on the framework target
https://www.swift.org/blog/library-evolution/
https://developer.apple.com/videos/play/wwdc2019/416/
I fetch the same problem when I try to update a library. My Xcode version was 13.2 with the swift version5.5.2. But the library I want to update required a swift version of 5.7.0. Using toolchains in Xcode might be the solution but I decided to update the Xcode version with the latest.
I update my Xcode to the latest version 14.1 and the issue is resolved. Automatically the swift version is found on the latest Xcode.

When Update to Latest Xcode Getting Error: "could not build objective-c module csqlite"

Updated to latest xcode version and swift sdk now getting error could not build objective-c module 'csqlite' i am using Sqlite Library using CocoaPods i.e pod 'SQLite.swift'
After searching losts of material online i have found the solution fortunately not answer at stackoverflow. I just replaced three import statements from import CSQLite to "import SQLite3" resolved the problem for me.
Adding answer for helping others having same issue.
Thanks Peace

Module compiled with swift 4.0 cannot be imported in swift 3.0.2

I just used Xcode 9 beta version and did not even compile my app. Now I am not able to run it in Xcode 8. The framework import is giving error. I have to give the archive. Help please. In the snapshot attached , I am importing an external framework MMCardView written in swift. Now that is throwing error in Xcode 8. What should i do?
Try cleaning the project from Product -> Clean in Xcode 8 and build again.

Issues with cocoapods after upgrading Xcode

Updated my Xcode project and my IQKeyboardManager cocoapod was not working. I updated it and now I get this error:
Module file was created by an older version of the compiler; rebuild IQKeyboardManagerSwift
Any help on how to 'rebuild' a cocopod?
You can't rebuild the Cocoapods repo. You need to use the Use Legacy Swift Language Version to YES in your project.

Framework issue - Module file was created by an older version of the compiler

I'm using
newest OpenXSDKframework (debug)
included in embedded Binaries
Build Settings: Embedded Content Contains Swift Code YES
Other linker -Objc
XCode 7.31
swift
when import OpenXSDKCore
this error is showing
.../ViewController/OpenXBannerViewController.swift:11:8: Module file
was created by an older version of the compiler;
rebuild 'OpenXSDKCore' and try again:
.../OpenXSDKCore.framework/Modules/OpenXSDKCore.swiftmodule/i386.swiftmodule
is this related to the Framework producing Company ?
what should i do - to fix that error?
thanks
That error will occur if the compiled framework (binary) was compiled using earlier version of compiler and in the most of the iOS cases it means that the binary was compiled using some earlier versions of Xcode.
Most probably, your OpenXSDKCore was not built using Xcode 7.3 that you use. The best course of action would be downloading the framework source code and compiling it by yourself.
If you don't have that option you can only wait or downgrade to earlier Xcode version.