Hello,
I'm using carthage version 0.26.2, and when trying to update with carthage update --platform iOS I get, only for Moya, this error:
*** Skipped installing Moya.framework binary due to the error:
"Incompatible Swift version - framework was built with 4.0 (swiftlang-900.0.65.2 clang-900.0.37) and the local version is 4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)."
*** Checking out Moya at "10.0.0"
Here is my Cartfile:
github "Moya/Moya" "10.0.0"
Would you have any idea of why or how I could make this work ?
Hey @Nitner0C. I'm no expert here, but my guess would be that your cached binary of Moya was built with different Swift version, therefore you can't use it in this project and Carthage needs to rebuild it (thus checking out Moya, I guess there is a building phase afterwards).
This is just a wild guess, so maybe a Carthage expert would help (cc @AndrewSB)
Yep, what @sunshinejr says seems to be the case indeed.
How can this be fixed?
When I try using carthage update --platform iOS --no-use-binaries, I get this error.
* Fetching Result
Fetching Alamofire
Fetching ReactiveSwift
Fetching RxSwift
Checking out RxSwift at "4.0.0"
Checking out Result at "3.2.4"
Checking out ReactiveSwift at "2.0.1"
Checking out Alamofire at "4.5.1"
Checking out Moya at "10.0.0"
xcodebuild output can be found in /var/folders/dc/2x74h7m55790qbk5j04sp1hxnhbmwk/T/carthage-xcodebuild.gx8Faa.log
Building scheme "Alamofire iOS" in Alamofire.xcworkspace
Building scheme "Result-iOS" in Result.xcodeproj
Building scheme "ReactiveSwift-iOS" in ReactiveSwift.xcworkspace
Building scheme "RxBlocking-iOS" in Rx.xcworkspace
Building scheme "RxCocoa-iOS" in Rx.xcworkspace
Building scheme "RxTests-iOS" in Rx.xcworkspace
Building scheme "RxSwift-iOS" in Rx.xcworkspace
* Building scheme "Moya" in Moya.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/Carthage/Checkouts/Moya/Moya.xcodeproj -scheme Moya -configuration Release -derivedDataPath /Users/schitlangia/Library/Caches/org.carthage.CarthageKit/DerivedData/9.1_9B55/Moya/10.0.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/Carthage/Checkouts/Moya)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/dc/2x74h7m55790qbk5j04sp1hxnhbmwk/T/carthage-xcodebuild.gx8Faa.log
@shwetachitlangia can you please paste the xcodebuild log? (At the end of your error log in carthage build you have a path to it)
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/corentin/Documents/work/squarebreak/ofs-public-app/Workspace/Carthage/Checkouts/Moya/Moya.xcodeproj -scheme Moya -configuration Release -derivedDataPath /Users/corentin/Library/Caches/org.carthage.CarthageKit/DerivedData/9.1_9B55/Moya/10.0.0 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /Users/corentin/Documents/work/squarebreak/ofs-public-app/Workspace/Carthage/Checkouts/Moya)
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/8q/qt85tzgd0jv5700x2m94b5vm0000gn/T/carthage-xcodebuild.uUXpyU.log
It seems to fail because of a SwiftLint violation, can you verify @sunshinejr?
Done linting! Found 12 violations, 1 serious in 51 files.
** ARCHIVE FAILED **
The following build commands failed:
PhaseScriptExecution Swiftlint /Users/corentin/Library/Caches/org.carthage.CarthageKit/DerivedData/9.1_9B55/Moya/10.0.0/Build/Intermediates.noindex/ArchiveIntermediates/Moya/IntermediateBuildFilesPath/Moya.build/Release-iphoneos/Moya.build/Script-46AE31F21F86DDC6004E4236.sh
(1 failure)
Oh snap, it could be it @BasThomas. Damn it, I knew SwiftLint build step is hard to do against Carthage installation process, still didn't have time to properly test it. Linting errors/warnings shouldn't prevent users from installing Moya, so we need to fix it ASAP.
Agree. Is this something we should report upstream too?
@BasThomas you mean add an issue to Carthage?
And/or Swiftlint, yes.
Sent with GitHawk
I'm not sure if any of these would be interested in it, but we could try at least try to make an example/guide or just warn people about consequences on Carthage/SwiftLint.
To those who have this issue, as a quick fix you can remove the swift lint in the build phase of the Carthage/Checkouts/Moya/Moya.xcodeproj of the 3 targets and run carthage build --plateform iOS
I got this error.
***Building scheme "RxMoya" in Moya.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /../Carthage/Checkouts/Moya/Moya.xcodeproj -scheme RxMoya -configuration Release -derivedDataPath //Library/Caches/org.carthage.CarthageKit/DerivedData/9.1_9B55/Moya/10.0.0 -sdk watchos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath ./ SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO (launched in /../Carthage/Checkouts/Moya)
The error "Incompatible Swift version" should be fixed by using Moya 10.0.1. I built the frameworks with the latest swift "4.0.2 (swiftlang-900.0.69.2 clang-900.0.38)"
I'm seeing a similar issue with the now latest swift Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2) but the log shows a different error
Carthage/Checkouts/Moya/Sources/ReactiveMoya/MoyaProvider+Reactive.swift:36:13: error: value of type 'CompositeDisposable' has no member 'observeEnded'
lifetime.observeEnded {
This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
This issue has been auto-closed because there hasn't been any activity for at least 21 days. However, we really appreciate your contribution, so thank you for that! 馃檹 Also, feel free to open a new issue if you still experience this problem 馃憤.
This is happening again with today's release of Swift 4.1. Removing the swift lint in the build phase did help.
Mind re-opening this, @sunshinejr @BasThomas ?
Thanks for letting us know @CocoaPriest. I'm tackling this as we speak.
Edit: @CocoaPriest could you please let us know what command did you use and what was the result of it? Oh, and also what Moya version do you use?
@sunshinejr I'm using the script to create static frameworks (like this one) but basically it consists of
carthage update "$@" --no-build --no-use-binaries
and
carthage build "$@" --platform ios --no-use-binaries
And I see just a "regular" compile failure:
*** Building scheme "Moya" in Moya.xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/kostik/dev/x/Carthage/Carthage/Checkouts/Moya/Moya.xcodeproj -scheme Moya -configuration Release -derivedDataPath /Users/kostik/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/Moya/11.0.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO BITCODE_GENERATION_MODE=bitcode CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/6p/_g9k66g13sb8_xzsv3stb07w0000gn/T/Moya SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/kostik/dev/x/Carthage/Carthage/Checkouts/Moya)
Logs are full of lint warnings & errors. This is Moya 11.0.1.
Btw, the same happens if you just try to compile the example project in Xcode. Same lint issues.
@CocoaPriest I've created a PR that fixes lint errors and removes the SwiftLint build phase. This should fix the problem for now, and for a further improvement I will just create a new issue.
If you could test this branch, remove_swiftlint_buildphase (and remove the Moya cache on Carthage/Cartfile.resolved), it would be awesome.
@sunshinejr thanks! Will test it (but not until the day after tomorrow)
@sunshinejr remove_swiftlint_buildphase works like a charm
@BasThomas we can keep this open as the PR didn't land yet 馃槄
Also, @CocoaPriest there is an another PR that instead of removing the build phase, uses it only in debug mode. Can you try this one as well (#1619)? As we would prefer it actually, because it solves the problem for Carthage users without removing a tool in our development process.
@sunshinejr just checked it, swiftlint-fix works for me as well.
That's cool, thanks for the help @CocoaPriest! 馃憣
Most helpful comment
I'm seeing a similar issue with the now latest swift
Apple Swift version 4.0.3 (swiftlang-900.0.74.1 clang-900.0.39.2)but the log shows a different error