Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carthage failed to build #208

Open
thang2410199 opened this issue May 13, 2019 · 15 comments
Open

Carthage failed to build #208

thang2410199 opened this issue May 13, 2019 · 15 comments

Comments

@thang2410199
Copy link

thang2410199 commented May 13, 2019

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'.

@freak4pc
Copy link
Member

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 ?

@thang2410199
Copy link
Author

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
Copy link
Author

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

@hk05
Copy link

hk05 commented May 13, 2019

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.

@freak4pc
Copy link
Member

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

@Ronaldoh1
Copy link

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)

@thang2410199
Copy link
Author

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

@thang2410199
Copy link
Author

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

@freak4pc
Copy link
Member

freak4pc commented Jun 5, 2019

Ok, so can we close this?

@Ronaldoh1
Copy link

@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
Copy link

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

@freak4pc
Copy link
Member

freak4pc commented Jun 7, 2019

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

@hannahmestes
Copy link

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
Copy link

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

@freak4pc
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants