1
votes

I recently had to update to Xcode 10.2 since my iPhone automatically updated to iOS 12.2 and I have to use it for some in-app purchase testing.

The project uses Swift 4.2 and Realm.

I knew I had to update Realm so here is what I did...

  1. Downloaded realm-swift-3.14.1
  2. In Xcode, I replaced the frameworks with the latest from the download in my case the ones inside folder, swift-10.2.

"In the past the Realm folders used to be labeled as the Swift version now they are labeled per the Xcode version"

  1. Compiled and then I got the following error.

Module compiled with Swift 4.2 cannot be imported by the Swift 5.0 compiler: /Users/userName/MyApp/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule

enter image description here

What am I missing?

What do I need to do to be able to use my Swift 4.2 project inside Xcode 10.2 and RealmSwift?

Is RealmSwift ready for Xcode 10.2?

2

2 Answers

1
votes

On Xcode, click on your xcodeproj file. Then on the left bar, choose the target. Now click to the build setting tab and look for the Swift language version.

Here you can change the swift version to select the 4.2 again.

Swift Compiler Language menu

1
votes

That error should only show if you were using a version built in older versions of Xcode (for instance, if you using Realm from swift-10.1 directory). Try to remove any Realm frameworks you have from the project, clean the project, delete project's derived data directory, restart Xcode and then make sure to add both Realm and RealmSwift from the swift-10.2 directory.