Module compiled with Swift 3.0 cannot be imported in Swift 2.3

后端 未结 4 673
执笔经年
执笔经年 2020-12-18 18:05

This is what I do:

import BSTableViewReorder

and get the following error:

Module compiled with Swift 3.0 cannot be i

相关标签:
4条回答
  • 2020-12-18 18:19

    in my case, the framework developers added this line in the code that was intended for the Podfile:

    config.build_settings['SWIFT_VERSION'] = '2.3' # or '3.0'
    

    as you can see, they defaulted to '2.3', which caused problems because i was running 3.0. simply removing the '2.3' # or and leaving the '3.0' fixed the problem.

    0 讨论(0)
  • 2020-12-18 18:21

    If you are using any third party frameworks just update them once for Xcode 8.1 and change the Use Legacy Swift Language Version to NO.

    0 讨论(0)
  • 2020-12-18 18:40

    If the above suggestions don't work for you try deleting ~Library/Developer/Xcode/DerivedData

    0 讨论(0)
  • 2020-12-18 18:44

    You'll need to change the Use Legacy Swift Language Version to NO - this makes sure your project will use swift 3.

    If you want to package your project as a POD (for cocoapods) you'll need to add a file named .swift-version (containing 1 single line, "3.0"). This will tell cocoapods to use the swift 3 compiler.

    Everything should work after this changes.

    0 讨论(0)
提交回复
热议问题