Moya: Can't build RxMoya with Moya v14.0.1 using Carthage v0.37.0

Created on 23 Feb 2021  路  7Comments  路  Source: Moya/Moya

Moya version: release 14.0.1
RxSwift version: 6.1.0
Alamofire version: 5.1.0
Carthage version: 0.37.0

My Cartfile looks like below:
github "ReactiveX/RxSwift" ~> 6.1.0
github "Moya/Moya" "14.0.1"
github "Alamofire/Alamofire" "5.1.0"

Command: carthage build Moya --use-xcframeworks --no-use-binaries --platform iOS
Expected: It should build and create a Moya XCFramework file in the Carthage build folder.
Actual: There is a "Moya.xcframework" created in the "/Carthage/Build" folder. But the above command fails with the following error.

CompileSwift normal arm64 (in target 'RxMoya' from project 'Moya')
CompileSwift normal armv7 (in target 'RxMoya' from project 'Moya')

/Carthage/Checkouts/Moya/Sources/RxMoya/MoyaProvider+Rx.swift:24:29: error: type 'Result' has no member 'error'
single(.error(error))
~^~~~

* ARCHIVE FAILED *

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

Can someone advise on how to solve this issue and successfully build the Moya XCFramework?

carthage rxmoya

Most helpful comment

I have the same error but with ReactiveMoya

All 7 comments

I have the same problem

The problem might be more related to the fact that Moya 14.0.1 uses RxSwift 5.0 and you are linking against RxSwift 6.0 in your Cartfile, which will probably not work.

@s-wolff In my cartfile I was linking to RxSwift "5.1.1"

If we compare version we can see that Result library was removed from submodules
https://github.com/Moya/Moya/compare/14.0.0...14.0.1

I have the same error but with ReactiveMoya

I see issue with ReactiveMoya

I have the seem error in mac mini with m1

import Alamofire
       ^

** ARCHIVE FAILED **


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

Is there a fix for m1?

Was this page helpful?
0 / 5 - 0 ratings