RxSwiftExt icon indicating copy to clipboard operation
RxSwiftExt copied to clipboard

Carthage failed to build

Open thang2410199 opened this issue 6 years ago • 15 comments

Hello, I tried to include RxSwiftExt in my carthfile and had some errors, my env:

swift --version
Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5)
Target: x86_64-apple-darwin18.5.0

Xcode 10.2.1 (10E1001)

swiftlint 0.32.0

carthage 0.33.0

My carthfile:

github "Alamofire/Alamofire" == 4.8.2
github "Alamofire/AlamofireImage" == 3.5.2
github "Moya/Moya" ~> 13.0
github "ReactiveX/RxSwift" "5.0.1"
github "ReactiveCocoa/ReactiveSwift" "5.0.1"
github "RxSwiftCommunity/RxSwiftExt" "5.0.0"
github "RxSwiftCommunity/RxGesture" "2.2.0"
github "RxSwiftCommunity/RxDataSources" "4.0.1"

Xcode throws a lots of Use of undeclared type 'Element'.

thang2410199 avatar May 13 '19 16:05 thang2410199

If it says "undeclared type" element it seems to me you didn't properly update your Carthage dependencies with carthage update.

Care to share your Cartfile.resolved ?

freak4pc avatar May 13 '19 16:05 freak4pc

Here it is:

github "Alamofire/Alamofire" "4.8.2"
github "Alamofire/AlamofireImage" "3.5.2"
github "Moya/Moya" "13.0.1"
github "ReactiveCocoa/ReactiveSwift" "5.0.1"
github "ReactiveX/RxSwift" "5.0.1"
github "RxSwiftCommunity/RxDataSources" "4.0.1"
github "RxSwiftCommunity/RxGesture" "2.2.0"
github "RxSwiftCommunity/RxSwiftExt" "5.0.0"
github "antitypical/Result" "4.1.0"
github "danielgindi/Charts" "v3.1.1"
github "thang2410199/SkeletonView" "0e4855d266658a9f11ae5f76496052013ab12caa"

thang2410199 avatar May 13 '19 17:05 thang2410199

I run carthage update --cache-builds --platform iOS

thang2410199 avatar May 13 '19 17:05 thang2410199

FWIW: This weekend I have experienced quite a few (understatement) problems updating my Rx libraries to the latest versions (Swift 5, using Carthage). I ended up removing dependency on RxSwiftExt, and now my project builds fine again. Unfortunately I did not keep the logs, to help you further with what happened, but I'd like to share that I also experienced issues with updated carthage.

hk05 avatar May 13 '19 18:05 hk05

@thang2410199 Please provide a reproducible project with the issue. Thanks.

freak4pc avatar May 15 '19 12:05 freak4pc

I have the same problem with Xcode 10.2.1 ....

IntermediateBuildFilesPath/RxSwiftExt.build/Release-iphoneos/RxSwiftExt-iOS.build/Objects-normal/arm64/zipWith.bc Command CompileSwift failed with a nonzero exit code

** ARCHIVE FAILED **

The following build commands failed: CompileSwift normal armv7 CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler CompileSwift normal arm64 (3 failures)

Ronaldoh1 avatar Jun 04 '19 17:06 Ronaldoh1

@freak4pc Sorry I forgot to check the thread, I will provide a sample soon.

thang2410199 avatar Jun 04 '19 17:06 thang2410199

I tried again today, build process successes on both sample and prod project.

thang2410199 avatar Jun 05 '19 11:06 thang2410199

Ok, so can we close this?

freak4pc avatar Jun 05 '19 12:06 freak4pc

@freak4pc I'm still having problems. what are the versions required ?/

I'm running Xcode10.2.1

carthage version 0.33.0

swiftlint 0.32.0

Apple Swift version 5.0.1 (swiftlang-1001.0.82.4 clang-1001.0.46.5) Target: x86_64-apple-darwin18.6.0

Ronaldoh1 avatar Jun 05 '19 16:06 Ronaldoh1

Ok.

Seems like we have to include RxRelay in your frameworks.

add the framework to Link Binary with Libraries

then add new path to your Run script

$(SRCROOT)/Carthage/Build/iOS/RxRelay.framework

Ronaldoh1 avatar Jun 06 '19 22:06 Ronaldoh1

Yeah, that makes sense not only in the context of RxSwiftExt, but also RxCocoa itself. Since RxCocoa depends on RxRelay.

freak4pc avatar Jun 07 '19 08:06 freak4pc

I am running into this problem today, with similar problems as @Ronaldoh1 when using Carthage. Everything works fine if I remove RxSwiftExt- I also tried this with including ONLY RxSwift and RxSwiftExt in my Cartfile and building from scratch, and the error persists.

Build file output:

** ARCHIVE FAILED **

The following build commands failed: CompileSwift normal armv7 CompileSwiftSources normal armv7 com.apple.xcode.tools.swift.compiler CompileSwift normal arm64 CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (4 failures)

I also noticed these errors in the build log:

Project/Carthage/Checkouts/RxSwiftExt/Source/RxSwift/fromAsync.swift:89:29: error: type 'Result<PrimitiveSequence<SingleTrait, Self.Element>.Element, Error>' (aka 'Result<Self.Element, Error>') has no member 'error' 
single(.error(FromAsyncError.inconsistentCompletionResult))

Project/Carthage/Checkouts/RxSwiftExt/Source/RxSwift/fromAsync.swift:87:29: error: type 'Result<PrimitiveSequence<SingleTrait, Self.Element>.Element, Error>' (aka 'Result<Self.Element, Error>') has no member 'error' 
 single(.error(error))

hannahmestes avatar Oct 28 '20 22:10 hannahmestes

I solved my problem: specify for Carthage to use RxSwift version 5.1.1 instead of newest 6.x

hannahmestes avatar Oct 28 '20 23:10 hannahmestes

Thanks ! I'll take a look. This project doesn't target RxSwift 6 yet since it's in RC1.

freak4pc avatar Oct 29 '20 04:10 freak4pc