I tried to use TinyCrayon in my new iOS project.
The library consists of a binary library framework. The link of the framework is dead in the TinyCrayon readme but it can be found here.
When I add the framework to my project and compile it, the following error messages are shown:
(When compile with a real iPhone device:)
The following binaries use incompatible versions of Swift:
/…/TCMask.framework/TCMask
/…/Library/Developer/Xcode/DerivedData/.../Build/Products/Debug-iphoneos/….app/…
(When compile with a simulator:)
/…/TCMask.framework/TCMask compiled with older version of Swift language (4.1/4.2) than previous files (5 or later) file ‘/…/TCMask.framework/TCMask' for architecture x86_64
I’m using Xcode 12.5.1
Is anyone can use this framework successfully?
If the author of this library upgrades it to using Swift 5 should solve the problem but he seems not maintaining this project already.
Potential root causes
If the developer of the framework/module you are using hasn’t updated their code to swift 5, it might be easiest to switch back to the older Xcode version. Just rename the current Xcode app (to XcodeNew for ex.). Then download and install an older version (https://developer.apple.com/download/more/ ). It might not be the best solution, but it will work until you can update the framework used.
Swift does not yet have module stability. This means that the Swift 5 compiler can compile code written for Swift 4, 4.2 and 5; however you cannot mix and match code that was built with older versions of the compiler. You need to make sure that all dependencies of your app are rebuilt with the Swift compiler from Xcode 10.2.
(Google translate of the website) I still have experience downloading the old version of Xcode from old articles, first successfully compiling and then pushing Git.
The topic of this article is about Swift 4.1, Xcode 9.3 can be programmed in Swift, I thought that just a small update would not be a big deal, but I did not expect a problem with the Libray/Framework I used! ! ! The fourth version of Swift mentioned that the Charts package is super easy to use. It needs to be compiled with Swift 4.0, so you have to go somewhere to choose a setting. Update to Swift 4.1 today.
I tried following but not success
Attempt #1
Remove files in DerivedData
folder of Xcode
Attempt #2
Set Swift Language Version
to Swift 4.0
in Build Settings
Attempt #3
Install the latest Toolchain (Swift 5.4.3)
and use the toolchain in Preferences
> Components
(And the app can't be compiled)
(I should install a Toolchain with an older version of Swift but I can't find it in the website)
(Moreover, Apple App Store should reject the app made by Toolchain?)
Install Xcode Toolchain of specific Xcode version which was working for you from here. An Xcode toolchain includes a copy of the compiler, lldb, and other related tools needed to provide a cohesive development experience for working in a specific version of Swift. Open Xcode's Preferences, navigate to Components > Toolchains , and select the installed Swift toolchain. This will let you compile and run the app for now.
Attempt #4
Download old Xcode 10.3 at developer.apple.com
It can't be run on my macOS 11.4
An error popup is shown:
Xcode quit unexpectedly while using the libMainThreadChecker.dylib plug-in
Attempt #5
After downloaded the old Xcode 10.3
I set Preferences
> Locations
> Command Line Tools
to Xcode 10.3
Attempt #6
Change Project Format to Xcode 8.0-compatible
ref
Attempt #7
Set Build Libraries for Distribution
to Yes
in Build Settings
(Should set this by the author of the library but not me?)