Carthage: Module file was created by an older version of the compiler

Created on 23 Jul 2015  路  29Comments  路  Source: Carthage/Carthage

Module file was created by an older version of the compiler: /Users/user/Library/Developer/Xcode/DerivedData/project-bqbyywemjnvvodecjidroebdmlnu/Build/Products/Debug-iphonesimulator/library.framework/Modules/library.swiftmodule/x86_64.swiftmodule

I'm getting the above error after building via carthage update. Xcode 7 beta complains that the swift module is built with an older version of the compiler. Any ideas?

question

Most helpful comment

Just in case someone comes along scratching their head at this issue as I was today:

My problem was occurring when using antitypical/Result. A normal carthage build finished rather quickly and even though xcode-select -p was totally on my side, I couldn't figure out why Xcode was complaining about an older version of the compiler.
A few hours later it hit me that Result was being used by Carthage as a prebuilt binary and was never built with my version of the Xcode-beta on my machine. Running carthage update --no-use-binaries saved my sanity 馃檭

All 29 comments

Are you using the right version of xcodebuild? What do you see when you run xcode-select -p? It should be pointed at Xcode 7 if you want to use the frameworks in Xcode 7.

Yes I'm pointed at Xcode 7

The framework contains Swift 2.0 so I couldn't built it otherwise. If it helps it builds fine for iOS devices but this error comes up when I try to run the app in the simulator.

Any word on this yet?

looks like it's fixed by a later version of Xcode

Hi. I updated to XCode 7.1 and I'm getting the same error when trying to build:
error: module file was created by an older version of the compiler; rebuild 'Alamofire' and try again.

Any ideas why this can be happening?

Thx!

L.

@ramirez Did you rebuild the framework by carthage build with the command line tools of Xcode 7.1? If the framework was built with Xcode 7.0, the error would happen.

@ikesyo : Yes, I used carthage build --platform iOS and it worked for all but one of the frameworks that I included. The framework that fails uses the other frameworks that were just built.

How about rm -rf ~/Library/Developer/Xcode/DerivedData/Alamofire-* then redo carthage build? I have no idea other than that.

It didn't work. The only difference I can see in the log file is that Alamofire uses one SDKROOT:

Build settings from command line:
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphonesimulator9.1

=== BUILD TARGET Alamofire iOS OF PROJECT Alamofire WITH CONFIGURATION Release ===

and the failing framework uses a different one:

Build settings from command line:
ONLY_ACTIVE_ARCH = NO
SDKROOT = iphoneos9.1

=== BUILD TARGET MyKitiOS OF PROJECT MyKit WITH CONFIGURATION Release ===

Could that be the problem? How can I change the used SDKROOT?

Thx!

Alamofire is not the problematic one, right? If so, you might have to rm -rf ~/Library/Developer/Xcode/DerivedData/MyKit-* instead of Alamofire. I'm not sure what the issue you are facing is...

The only difference I can see in the log file is that Alamofire uses one SDKROOT

That is because Carthage builds both for simulator archs (SDKROOT = iphonesimulator) and device archs (SDKROOT = iphoneos). There should be SDKROOT = iphoneos lines for building Alamofire. I don't think that is related to the problem.

The:

rm -rf ~/Library/Developer/Xcode/DerivedData/MyKit-*

did the trick, thanks!

Just in case someone comes along scratching their head at this issue as I was today:

My problem was occurring when using antitypical/Result. A normal carthage build finished rather quickly and even though xcode-select -p was totally on my side, I couldn't figure out why Xcode was complaining about an older version of the compiler.
A few hours later it hit me that Result was being used by Carthage as a prebuilt binary and was never built with my version of the Xcode-beta on my machine. Running carthage update --no-use-binaries saved my sanity 馃檭

Thanks @kiliankoe! That was the option I was looking for!

Thanks @kiliankoe ! it save me

ubuntu 15.4 error: module file was created by an older version of the compiler; rebuild 'PackageDescription' and t

Don't worry about this issue. I found this same problem, however I have resolved it. I used about 10 third party library (Alamofire, SwiftyJSON, etc., ) , it works on Xcode7.2.
After I upgraded Xcode7.2 to XCode7.3, I found this issue : Module file was created by an older version of the compiler; rebuild and try again

Solution: You only need to rebuild this carthage file again using terminal:
carthage update --platform iOS, that's all.

Have this problem too.
I think the problem is when using the download binary feature. Then you get a prebuild framework from github that may be build with another XCode version. It makes sense that the "--no-use-binaries" param solve this.

Had this same issue ...as suggested using the param "--no-use-binaries" fixes it but make sure to add the platform param to checkout the platform specific code to prevent time/memory wastage
(carthage update --platform iOS --no-use-binaries)

@kiliankoe I 鉂わ笍 U 馃槀

XCode Version 7.3.1 (7D1014)

cmd+r
import Alamofire // Module file was created by an older version of the compiler; rebuild 'Alamofire' and try again: /Users/.../Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule

cmd+opt+shf+k
$ rm -rf ./DerivedData/
$ rm -rf ./Carthage/
$ carthage update --platform iOS --no-use-binaries
cmd+r

Module file was created by an older version of the compiler; rebuild 'Alamofire' and try again: /Users/.../Alamofire.framework/Modules/Alamofire.swiftmodule/x86_64.swiftmodule

?

XCode 8 and same error, trying the fixes suggested here. I am having problem with SwiftyJSON.

Hi, I too have the same error with Xcode 8. Not sure how to implement some of these solutions above.
image

Hi,i have the same error with Xcode 8 ,Carthage 0.18. I made some attempts in accordance with the method of the page, but have no effect.I don't have any choice

For me Cleaning up the Build folder Cmd ⌘ + Alt ⌥ + Shift ⇧ + K worked.

So I ran into this issue specifically with adding ReactiveCocoa. I fixed the issue by using the most recent pre-release version of ReactiveCocoa. That is, I replaced github "ReactiveCocoa/ReactiveCocoa" with github "ReactiveCocoa/ReactiveCocoa" "5.0.0-alpha.3" in my Cartfile

I am facing same problem but not with an external library or pod but with apple's PassKit and EventKit

jus "rm -rf " the given Passkit and EventKit files. And just clean the xocde and rerun. Passkit and EventKit location will be in the error. (For me the the location is '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/PassKit.swiftmodule')

just use following
rm -rf /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator/x86_64/PassKit.swiftmodule

I love you @kiliankoe

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hamchapman picture hamchapman  路  3Comments

faustperic picture faustperic  路  3Comments

justinmakaila picture justinmakaila  路  4Comments

rogernolan picture rogernolan  路  3Comments

JustinJiaDev picture JustinJiaDev  路  3Comments