Moya: Carthage build fail

Created on 24 Mar 2016  Â·  7Comments  Â·  Source: Moya/Moya

After updating to Xcode 7.3 (7D175) I get these errors when running carthage update, I'm also using Carthage 0.15.2, I also tried changing xcode-select to another Xcode of 7.2.1 without any success..

/Users/xx/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Plugins/NetworkActivityPlugin.swift:2:8: error: module file was created by an older version of the compiler; rebuild 'Result' and try again: /Users/xx/Documents/Projekt/app/Carthage/Checkouts/Moya/Carthage/Build/iOS/Result.framework/Modules/Result.swiftmodule/arm64.swiftmodule

The following build commands failed: CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Moya+Alamofire.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Error.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Image.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Plugins/NetworkActivityPlugin.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Response.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Endpoint.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Plugins/CredentialsPlugin.swift CompileSwift normal arm64 /Users/x/Documents/Projekt/app/Carthage/Checkouts/Moya/Source/Plugins/NetworkLoggerPlugin.swift CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (9 failures)

Hopefully someone of you guys might have an idea why this happens.. :)

carthage

Most helpful comment

carthage update --platform iOS --no-use-binaries

All 7 comments

I suggest you try removing the entire Carthage/build folder and run carthage update --platform ios --no-use-binaries. That might work – no need to fall back to Xcode 7.2.1. ;)

Carthage by default tries to reuse an already built framework (like here Result) as long as the specified version didn't change. You can force Carthage to rebuild by removing the build folder. Also I've added --platform ios as this saves time by not building possibly existing (but in iOS-only projects unnecessary) tvos, osx and watchos targets. Additionally --no-use-binaries ensures no pre-build binaries are downloaded.

@Dschee I have the exact same problem and tried your suggestion and unfortunately ended up with the same error.

This is a pretty serious issue, but I don't have sufficient Carthage experience to fix it. @Moya/contributors anyone have suggestions?

carthage update --platform iOS --no-use-binaries

Huge thanks @justinmakaila and company, here's what finally got me fixed up on this one:

  • Cleared DerivedData
  • Deleted Carthage's build and checkouts folders
  • Deleted Cartfile.resolved
  • Ran 'carthage update --platform iOS --no-use-binaries

I'm sure only part of that is required to fix the issue, (probably that last --no-use-binaries option was the _real_ fix, but building all of this takes forever so I wanted to be on a _completely_ clean state just in case).

I too am still somewhat of a Carthage novice, but my best guess is the release binary it was downloading (by default) for one of Moya's dependencies was incompatible, so specifying --no-use-binaries and re-building _everything_ from source fixed it up. Just a guess though.

That's exactly what the problem is. Haha

@jakemarsh I'm going to go ahead and close the issue. Feel free to reopen if this doesn't seem to work!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mwawrusch picture mwawrusch  Â·  3Comments

kamwysoc picture kamwysoc  Â·  3Comments

pedrovereza picture pedrovereza  Â·  3Comments

JoeFerrucci picture JoeFerrucci  Â·  3Comments

syq7970 picture syq7970  Â·  3Comments