Realm Swift in Xcode 10.2 - ERROR: Module compiled with Swift 4.2 cannot be imported by the Swift 5.0 compiler

General Tech Bugs & Fixes 2 years ago

1 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 31 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

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?

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.