Incompatibility XCode 11.4 - Swift 5.1.3 cannot be imported by the Swift 5.2 compiler

Hello there,
I was trying to build a codea project on my mac, something I hadn’t done in a while, and after going through yet another Xcode update / upgrade to 11.4, I now run into a Swift 5.2 incompatibility issue :

“:0: error: module compiled with Swift 5.1.3 cannot be imported by the Swift 5.2 compiler”

I’ve found in the forum a related issue and the following suggestion :
“Are you able to check the libversion file in your exported project? It should have the version 3.0.1 in it. If it doesn’t, you can modify it, delete the downloaded frameworks and re-build to ensure Xcode downloads the latest frameworks.”
but I am not quite sure if this means I need to delete the entire “Frameworks” directory that was exported from the codea app, or if I need to go inside each of the frameworks directories and delete … the modules directories ?
I can’t see anything in there though that would trigger a rebuild or re-import of swift 5.2 versions of the libs…
Apologies if these seem like clueless questions, it’s been a while since I last worked with codea.
Here’s my chance though to share my appreciation for an awesome application - kudos to the team.

@Denis, i reported the same issue at the end of this thread:

As you will see @Simeon promises a new version soon and that was some days ago!

Hey @piinthesky, thanks for link to the thread, I had missed it.
It turns out I was able to get the app to build and run by renaming the “SomeFrameworkName.swiftmodule” in the Modules directory in the Frameworks directories.
For example :
In /Frameworks/ToolKit.framework/Modules
I did :
mv ToolKit.swiftmodule ToolKit.swiftmodule_tmp
Had to do it for the RuntimeKit.framework also.
Now, I don’t really understand how that actually worked, and if the libs were downloaded and/or rebuilt where they might be now… but it was enough to get past the compilation error.

Another issue I’m noticing now is related to the assets - it looks like the new way of addressing assets isn’t working while the default/old way (which triggers warnings of obsolescence at runtime in codea) might still be working.

I will try to have updated frameworks for you all today some time. I’ll post with instructions on how to use

@Denis @piinthesky could you please both try the following:

  • Delete the frameworks from the frameworks folder
  • Open the file called libversion in the root of your exported project
  • Change the version number to 3.1
  • Rebuild (Xcode should download the latest frameworks)

@simeon, i tried that- the build succeeded and it tried to run on the simulator, but failed with the following error message…

dyld: Library not loaded: @rpath/CraftKit.framework/CraftKit
Referenced from: /Users/paschalcoyle/Library/Developer/CoreSimulator/Devices/6DB1D4DE-3BE1-4747-8C45-78C97CF68D3F/data/Containers/Bundle/Application/04BFE504-EB15-4D0C-A18F-03933C56F425/
Reason: image not found

is craftkit.framework missing somewhere?

The frameworks i deleted did not reappear in the xcode project navigator.
I did not exit xcode and restart.

@simeon, ahhh it looks like the craftkit framework files have not completed uploading- i will try again once they are finished…

Nope that did not change things.

I tried a completely new export, but that has libversion 3.0.1, so no good.

@piinthesky will keep working on this and will have an update soon

@Simeon I know you are working on this, but fyi, I just tried what you suggested and got a different error than @piinthesky :

:0: error: compiling for iOS 12.1, but module ‘RuntimeKit’ has a minimum deployment target of iOS 12.4: /Users/denisamselem/workspace/codea/Logan/SpaceRevolution/Frameworks/RuntimeKit.framework/Modules/RuntimeKit.swiftmodule/arm64-apple-ios.swiftmodule
Command MergeSwiftModule failed with a nonzero exit code

I can see though that the frameworks have been pulled and repopulated.


@dennis yes i got that error as well, but i changed the target to 13.4 in the build settings-should have mentioned that.

@Denis yeah for that one set the deployment target to 12.4 or higher

@Simeon, any joy solving the code export for the latest xcode? If not, i may try to go back to the old xcode/ios- although not sure it is possible

@piinthesky should work now? I’ve updated the frameworks, just make sure you delete your .framework files and rebuild in Xcode. You also need to set the deployment target to 12.4 or higher (I believe it will be set to 12.2 in the default Codea exported project)

#simeon, nope no luck, same problem, build succeeded but simulator gives error:

dyld: Library not loaded: @rpath/CraftKit.framework/CraftKit
Referenced from: /Users/paschalcoyle/Library/Developer/CoreSimulator/Devices/4B1CBB09-94F3-49E4-BCBA-EF18D38275FF/data/Containers/Bundle/Application/2660AA37-2121-49C3-9E4F-CAE5883294AF/
Reason: image not found

I set libversion to 3.1 and I can see the new frameworks have been loaded, although their dates are 7,8 April?

#Simeon, i think i might understand what is going…
when you told me to delete the frameworks, i did it inside the Xcode. Could it be that i should have done it directly in the files on the disk?

By adding the frameworks back manually in the general/frameworks they reappeared in the xcode framework section and I was able to run the simulator. Now it crashes within the codea on the simulator. I will do a new export and delete from the files-perhaps that will fix everything!

Oh I meant to delete them from your filesystem but leave the Xcode project as-is, sorry I wasn’t more specific!

@Simeon, yes, as i am very new to the xcode stuff, instructions have to be very precise! Anyway all works now. I see the new assets are now handled-good.
Next step try to get TestFlight operational.

@piinthesky yes understandable, Xcode is huge and sometimes I forget about my familiarity with it when writing here

@Simeon, for TestFlight, i think i have to generate an Archive. I tried to do this, but for this case the build fails with:

ld: warning: directory not found for option ‘-F/Users/paschalcoyle/Library/Mobile Documents/com~apple~CloudDocs/Documents/codea apps/evtdisplay200413/evtdisplay200413/Frameworks’
ld: bitcode bundle could not be generated because ‘/Users/paschalcoyle/Library/Mobile Documents/com~apple~CloudDocs/Documents/codea apps/evtdisplay200413/Frameworks/CraftKit.framework/CraftKit’ was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file ‘/Users/paschalcoyle/Library/Mobile Documents/com~apple~CloudDocs/Documents/codea apps/evtdisplay200413/Frameworks/CraftKit.framework/CraftKit’ for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas!?

@Simeon, setting ‘Enable Bitcode’ to NO in the build settings seem to solve this one.