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 update --platform ios . error #144

Closed
afeng159 opened this issue Apr 23, 2019 · 11 comments · Fixed by #145
Closed

carthage update --platform ios . error #144

afeng159 opened this issue Apr 23, 2019 · 11 comments · Fixed by #145

Comments

@afeng159
Copy link

Building scheme "RxAlamofire iOS" in .xcodeproj
Build Failed
Task failed with exit code 65:
/usr/bin/xcrun xcodebuild -project /Users/chenxufeng/Documents/work/apub-companion-ios/Carthage/Checkouts/RxAlamofire/
.xcodeproj -scheme RxAlamofire\ iOS -configuration Release -derivedDataPath /Users/chenxufeng/Library/Caches/org.carthage.CarthageKit/DerivedData/10.1_10B61/RxAlamofire/4.4.1 -sdk iphoneos ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES archive -archivePath /var/folders/q3/6zscgh7134d_b15cxfkrqpfw0000gn/T/RxAlamofire SKIP_INSTALL=YES GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=NO CLANG_ENABLE_CODE_COVERAGE=NO STRIP_INSTALLED_PRODUCT=NO (launched in /Users/chenxufeng/Documents/work/apub-companion-ios/Carthage/Checkouts/RxAlamofire)

@afeng159
Copy link
Author

error: SWIFT_VERSION '5.0' is unsupported, supported versions are: 3.0, 4.0, 4.2. (in target 'RxAlamofire iOS')

@freak4pc
Copy link
Member

@rynecheow Any idea ?

@afeng159
Copy link
Author

afeng159 commented Apr 24, 2019

xcode 10.1

@afeng159
Copy link
Author

Is there any way to resolve it?

@apparence
Copy link

I got exactly the same error

I am with swift 4.2 and RxAlamofire version 4.4.0

Does any one found a solution?

@sunshinejr
Copy link
Member

I took a quick look at the issue today @freak4pc.

So the problem is that the .xcodeproj is using Swift 5.0, but the .podspec is saying that CocoaPods should use Swift 4.2 to build the library. So, CocoaPods users will use this lib with Swift 4.2 and Carthage users will use it with Swift 5.0. Because of that, CocoaPods users will easily use this lib in Xcode 10.1/2 but Carthage users will unfortunately need Xcode 10.2 for it to build.

As I'm in no position to know which direction should RxAlamofire take I will point out most likely directions:

  • Lower down Swift version to 4.2 for Carthage users as well
  • Upgrade Swift version for CocoaPods users to 5.0 to make it consistent across platforms and cut maintenance cost

The first one would be the easiest solution for y'all here that can't install the new RxAlamofire version in your projects. The second one will be easier for maintainers here as it's pretty empty lately. In any case, if you guys want to resolve it by yourself now, there is a way:

carthage update RxAlamofire --platform iOS --no-build
sed -i -e 's/SWIFT_VERSION = 5.0/SWIFT_VERSION = 4.2/g' Carthage/Checkouts/RxAlamofire/_.xcodeproj/project.pbxproj
carthage build RxAlamofire --platform iOS

This fetches the project, updates the Swift version for xcodeproj (that Carthage uses) and builds it with Swift 4.2. Let me know if it works @apparence @afeng159.

Note: CI has integration checks for Swift 4.2 as well as Swift 5.0, so lowering down Swift version for Carthage users could be a good way for at least version 4.* of RxAlamofire.

@rynecheow
Copy link
Member

Thanks @sunshinejr for taking a look! I did the original pull request to support Swift 5 but unfortunately I've been tied up. I agree on the solutions and I'd say in the longer term, option 2 would be the more viable solution.
I think we should update the documentation to at least mention Xcode 10.1 users that are on up to Swift 4.2 should use RxAlamofire 4.2 instead, or bump the current release entirely to 5.0.0 so that it is a major version difference if we choose to support Swift 5.0 natively.

@freak4pc
Copy link
Member

If we raise the minimum to Swift 5, let’s wait for RxSwift 5. It’s supposed to be released over the next week or two.

@apparence
Copy link

Thanks a lot @sunshinejr works like a charm !

@sunshinejr
Copy link
Member

I agree @freak4pc. This way RxAlamofire could be upgraded to 5.0.0 as well. For the time being, it might be a good idea to update the xcodeproj to use Swift 4.2 and make a patch release as CocoaPods and CI is prepared for 4.2 anyways.

@freak4pc
Copy link
Member

@rynecheow Can you take care of this? We can release RxAlamofire 4.5.0 that only supports Swift 4.2 and RxAlamofire 5 which will work against RxSwift 5 and thus support only Xcode 10.2 and above (e.g. only the Swift compiler).

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

Successfully merging a pull request may close this issue.

5 participants