Module file was created by an older version of the compiler
Asked Answered
O

3

31

Using Carthage to manage my dependencies, everything runs fine in the simulator.

However, when building for a device I get the following error:

enter image description here

Module File was created by an older version of the compiler; rebuild Alamofire and try again: .../DerivedData/Build/Products/Debug-iPhones...

I have tried what others suggested to similar issues: deleting my derived data, reinstalling Carthage and rebuilding the frameworks. However, the error has been persistent.

Oppressive answered 16/4, 2016 at 7:52 Comment(9)
Are you using more than one Xcode on your Mac ?Remontant
@RahulKatariya No, just the latest official version of Xcode (not beta)Oppressive
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.Remontant
@RahulKatariya it's pointing to 7.3Oppressive
Did you use carthage update with --no-use-binaries option ?Remontant
@RahulKatariya yes, I tried that and got the same result unfortunatelyOppressive
Can you show your cartfile.private file?Remontant
@RahulKatariya Do you mean my Cartfile? That just has: github "Alamofire/Alamofire" ~> 3.3 github "SwiftyJSON/SwiftyJSON"Oppressive
I can only think of 3 options right now. GoodLuck :)Remontant
R
40

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.

Remove all the derive data rm -rf ~/Library/Developer/Xcode/DerivedData/ && carthage build

Also, When you use carthage update without --no-use-binaries option then it downloads the pre built frameworks which may be built using the old version of xcodebuild.

Alternative way is to use carthage update --no-use-binaries. This way it will compile all the frameworks with the latest Xcode build installed on your Mac.

Remontant answered 16/4, 2016 at 8:13 Comment(2)
I followed these steps (using carthage build) and it built successfully.Oppressive
Thank you, that worked for me. But, since I'm using CocoaPods instead of Carthage, i had to do a pod deintegrate and pod update to reinstall the frameworks.Limousin
C
1

I am using cocoapods.I just right-click the wrong framework,show it in Finder,remove it,and build the project again,solve the problem.

Crabtree answered 17/11, 2016 at 2:59 Comment(0)
C
0

You can try rebuilding the framework by command line:

  • Open Terminal
  • cd project/directory
  • carthage build

then clean the xcode project and run!

Compline answered 25/9, 2016 at 11:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.