Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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

in General Posts: 5

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.

Tagged:

Comments

  • Posts: 528

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

    https://codea.io/talk/discussion/10399/overview-of-xcode#latest

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

  • Posts: 5

    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.

  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • SimeonSimeon Admin Mod
    Posts: 5,362

    @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)
  • Posts: 528

    @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/evtdisplay200323.app/evtdisplay200323
    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.

  • edited April 7 Posts: 528

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

  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • Posts: 5

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

    Denis

  • Posts: 528
    @dennis yes i got that error as well, but i changed the target to 13.4 in the build settings-should have mentioned that.
  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • edited April 13 Posts: 528

    @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

  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • Posts: 528

    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/evtdisplay200325.app/evtdisplay200325
    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?

  • edited April 13 Posts: 528

    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!

  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • Posts: 528

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

  • SimeonSimeon Admin Mod
    Posts: 5,362

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

  • Posts: 528

    @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!?

  • Posts: 528

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

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Yeah I'll need to fix this one in the frameworks themselves so you can build with bitcode (though it's not a requirement)

  • edited April 14 Posts: 528

    @Simeon, a new one! (This is quite painful!).

    When trying to validate the App for distribution in the Administrator tool, I get this....

    Couldn't find CFBundleSupportedPlatforms in the Info.plist, LC_VERSION_MIN, or LC_BUILD_VERSION in the Mach-O for path "/Users/paschalcoyle/Library/Developer/Xcode/Archives/2020-04-14/evtdisplay200413 14-04-2020, 11.13.xcarchive/Products/Applications/evtdisplay200413.app/Frameworks/AudioKit.framework".

    Is that something i can fix, or do you have to do it?!

Sign In or Register to comment.