RxSwift: No such module 'RxCocoaRuntime'

Short description of the issue:

I’m facing a strange issue and I don’t know if it is a bug or I’m just missing something. I’m currently working for a big company but interestingly their build server doesn’t support CocoaPods, Carthage, or Swift Package Manager. So I added all frameworks by hand. I added RxSwift, RxCocoa, etc. (version 6.0) but it won’t build.

I also tried to use it in a completely fresh project.

Expected outcome:

I expect that it would work without a dependency manager as .xcframework files are provided.

What actually happens:

The project won’t build and I get the following message: Failed to build module 'RxCocoa' from its module interface; it may have been damaged or it may have triggered a bug in the Swift compiler when it was produced

Along with: No such module 'RxCocoaRuntime'

Self contained code example that reproduces the issue:

I’ve created a GitHub project of the issue - https://github.com/Brudus/framework-test

The imports in the AppDelegate.swift are enough to prevent the project from building.

RxSwift/RxCocoa/RxBlocking/RxTest version/commit

RxCocoa 6.0.0

Platform/Environment

  • iOS
  • macOS
  • tvOS
  • watchOS
  • playgrounds

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

  • easy, 100% repro
  • sometimes, 10%-100%
  • hard, 2% - 10%
  • extremely hard, %0 - 2%

Xcode version:

12.3

Installation method:

  • CocoaPods
  • Carthage
  • Git submodules
  • Manual

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

  • yes (which ones)
  • no

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

  • just starting
  • I have a small code base
  • I have a significant code base

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I’ll try taking a look at it later in the week, thank you for reporting it 😃

@freak4pc I’m getting this error when I have a binary framework that depends on RxCocoa in my project. My app also depends on RxCocoa through the Swift Package Manager.

Hello guys, I have the same issue with version 6.5.0.

I have Package.swift. I have a binary target in Package.swift. My code used RXCocoa, but I replace it to RxRelay and it’s enough for me. So, generally, RxRelay doesn’t use RxCocoaRuntime.

When I compile main project with dependency to my binary framework that have dependencies to RxSwift and RxRelay I have the error.

I downloaded RxCocoaRuntime from version 6.0.0 and add it to my main project and compilation success, but when I launch the app I see an error that dylib RxSwift doesn’t load. I remove RxCocoaRuntime and the app started launching while I will not clean the project.

Could you help with it?

Hey @Brudus, apparently we need to actually import a separate RxCocoaRuntime.xcframework as well (no need to actually import RxCocoaRuntime, but the framework needs to be in the import phase).

I’ve added it to the 6.0.0 release, let me know if that works: https://github.com/ReactiveX/RxSwift/releases/tag/6.0.0

This also appears to be missing from the latest 6.5.0 release.