ReactiveX / RxSwift

Reactive Programming in Swift
MIT License
24.39k stars 4.17k forks source link

Xcode 12.2 Beta 2 - make RxSwift and RxSwiftExt compatible from Swift Package Manager #2239

Closed anthonyroani closed 4 years ago

anthonyroani commented 4 years ago

Xcode 12.2 Beta 2 - Make RxSwift / RxSwiftExt compatible from Swift Package Manager:

In Xcode 12, iOS 8 have been dropped from the supported OS versions by Xcode.

Using SPM, RxSwift, RxSwiftExt and RxCocoa have by default the minimum OS version set to 8.0 into your Package.swift because there is no supported platform precised.

By default, the Swift Package Manager assigns a predefined minimum deployment version for each supported platforms unless configured using the platforms API. This predefined deployment version will be the oldest deployment target version supported by the installed SDK for a given platform.

See : https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html#supportedplatform

Expected outcome:

No warning in Xcode 12 and compilation is ok.

What actually happens:

It results into warnings in Xcode 12.2 and compilation error for the target I want to build.

Warnings is for the following libraries : RxSwift, RxCocoa, RxSwiftExt, RxBlocking, RxRelay :

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99.

Self contained code example that reproduces the issue:

No code needed to reproduce

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

RxSwift 5.1.1 RxSwiftExt 5.2.0

Platform/Environment

How easy is to reproduce? (chances of successful reproduce after running the self contained code)

Xcode version:

12.2 Beta 2

:warning: Fields below are optional for general issues or in case those questions aren't related to your issue, but filling them out will increase the chances of getting your issue resolved. :warning:

Installation method:

I have multiple versions of Xcode installed: (so we can know if this is a potential cause of your issue)

Level of RxSwift knowledge: (this is so we can understand your level of knowledge and formulate the response in an appropriate manner)

You have to add something like :

platforms: [.iOS(.v9)] into Package.swift, as you can see in many other libraries that uses SPM

freak4pc commented 4 years ago

Hey Anthony, We do not plan to bump the deployment target on RxSwift 5. RxSwift 6 will be iOS 9 and up (RC1 should be released tomorrow but you can direct to branch rxswift6 for now)

freak4pc commented 4 years ago

PS Would be great if you could check the branch. If anything feels wrong there do let me know :)

anthonyroani commented 4 years ago

Thanks for the information. I tried the branch rxswift6 (this removes the previous warnings and error I mentioned into my previous message)

Unfortunally I found another issue that is related to this one as my project is a multi-targets project :

https://github.com/ReactiveX/RxSwift/issues/2210

I get the error : Missing required module 'RxCocoaRuntime' when importing RxCocoa in another target which is a framework which is imported in the project.

I suppose it is still unresolved. I think I will wait for the next release tomorrow, I try to add RxSwift as a git submodule instead of using SPM.

freak4pc commented 4 years ago

Apple has been extremely unresponsive and moving very slowly to fix this (if at all). I'm still trying ta few hacks and hope to be able to support SPM at least partially.

https://bugs.swift.org/browse/SR-12303

freak4pc commented 4 years ago

I'm closing this for now, let me know if you have further questions.

bimawa commented 2 years ago

I use rxSwift in my framework like spm. And host app got this error? Have we some workaround? Or maybe params for linked objc?

minguking commented 1 year ago

if there's anyone still suffering from this error by using RxSwift as SPM, try to fix TEST_HOST from TEST_HOST = "$(BUILT_PRODUCTS_DIR)/<ProductName>.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/<ProductName> To TEST_HOST = "$(BUILT_PRODUCTS_DIR)/<ProductName>.app/<ProductName> so, just remove the /$(BUNDLE_EXECUTABLE_FOLDER_PATH) part.