I just started using Realm 2.0.4 yesterday with Xcode 8 and it worked fine. Today I updated to Xcode 8.1 and it no longer will compile. I get an error saying "Module compiled with Swift 3.0 cannot be imported in Swift 3.0.1."
How can I fix this? I have deleted Realm.framework and RealmSwift.framework from the embedded framework table and dropped in the 3.0.1 version, but the issue persists. I have deleted the DerivedData folder and it didn't work.
What do I do? I am not using CocoaPods or Carthage.
Just for future reference, a bunch of things that you can try:
- Clean the build folder (Go to the Xcode
Productmenu while holding down the Option key, then chooseClean Build Folder...) - Completely reinstall Realm by deleting the framework files from the project, copying them in again, and re-adding them to the
Embedded BinariesandLinked Frameworks and Librariesproject settings.
来源:https://stackoverflow.com/questions/40731926/realms-swift-module-compiled-with-swift-3-0-cannot-be-imported-in-swift-3-0-1