Realm - module file was created by an older version of compiler

你离开我真会死。 提交于 2019-12-31 01:47:11

问题


I use latest version of xcode and swift 2.2. One of my projects, which I havent open for several month now not building, because of error module file was created by an older version of compiler

I tried the following

  1. Removed realm frameworks from project, then download the latest version from realm.io and copy the new frameworks to project
  2. Building realm by build.sh build from github sources with REALM_SWIFT_VERSION=2.2 and adding to project

Neither of these helped, still got error.

Any advices ?


回答1:


Can you try the following?

  • Delete derived data
  • Clean the build folder (click on Xcode's Product menu while holding down the Option key, and choose the Clean Build Folder menu item)

Sometimes simply performing a clean build isn't sufficient to flush the invalid intermediate products or cached data.




回答2:


I had this issue when upgrading from Swift 2.2 to Swift 3.0, specifically for Realm Swift cocoapod. I think this solution should work for this general issue. Here is what worked for me:

(1) Go to derived data folder /Users/(yourUserName)/Library/Developer/Xcode/DerivedData

(2) Select project with error

(3) Delete

(4) Clean project

(5) Run

Cleaning initially did not work for me. Hope this helps!




回答3:


I faced the same issue when used Swift 3.2 in my project. After upgrading to Swift 4.0 issue disappeared. Cleaning project folder, derived data, restarting Mac - nothing helped.



来源:https://stackoverflow.com/questions/37919047/realm-module-file-was-created-by-an-older-version-of-compiler

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!