Group Group Group Group Group Group Group Group Group

Best practice on handling multiple versions of nested RXSwift Community dependencies (cocoapods)

Hello, thanks once again for such a great book.
On section 5 the book introduce RxSwift Community which it’s a great source of ready to use Rx extensions. Upon going through the existing extensions, I found out that most of the pods comes with their limited version of RxSwift, For example some comes with older versions of RxSwift and others with latest versions depending on how active the repo is.

So let’s say I have a project using the latest version of RxSwift then I install another library from the community which unfortunately uses the old version of RxSwift. What happens is I either get an error that the Podfile.lock specifies another version of RxSwift which isn’t supported on the library.

The solution is to force my project to use the same version as the library I am installing, which works for few dependancies. However as I add more RxExtensions it become a pain to handle the limitations of RxSwift version which is supported on those dependancies.

As an example consider the following pods in the same project pointing to different RxSwift versions: -

   ----> RxSwift 4.4.1
   ----> RxCocoa 4.4.1

    ----> RxSwift 5.5.1
   ----> RxCocoa 5.5.1

    ----> RxSwift 5.6.1
     ---> RxCocoa 5.6.1

how do others handle this issue? Do you avoid over relying on Community versions or there is a way to handle or allow different versions of RxSwift to run on each dependency?

I have attached a screenshot to show a sample error message which occurs when I try to install a dependancy which points to a different pod version.
@marin @freak4pc

Seems like it’s not possible to support multiple versions based on this old SO answer here: -

Yup, this is a CocoaPods/Package Manager thing and not an Rx thing. You cannot have multiple copies of the same framework on different versions this way.

1 Like

This topic was automatically closed after 166 days. New replies are no longer allowed.