Error Missing required module 'RxCocoaRuntime'
bangkm opened this issue · comments
If you still want to report issue, please delete above statements before submitting an issue.
Short description of the issue: Error Missing required module 'RxCocoaRuntime'
I am using RxCocoa in custom framework, so I am trying to inject dependencies with SPM and make that .xcframework. I made the .xcframework, but the following error keeps appearing.
The process of creating and configuring the framework project and creating the xcframework was as follows.
Development Environment
- CPU : Apple slicon (M1 PRO)
- MacOS : Ventura 13.1
- Xcode : 14.1
Step
- Create framework project (sdk-sample)
- Set Build Active Architecture Only YES from NO
- Mach-O Type is Dynamic Library
- Write simple code using RxSwift, Rxcocoa
- Create .xcarchive and .xcframework
- Created Package.swift as below and uploaded it to git
Expected outcome:
Download the SDK I created in other apps and use it normally
What actually happens:
Error occur, Missing required module 'RxCocoaRuntime'
Self contained code example that reproduces the issue:
Make xcarchive and xcframework
xcodebuild archive \
-scheme sdk-sample \
-archivePath ./archive/sdk-sample.framework-iphoneos.xcarchive \
-sdk iphoneos \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
xcodebuild archive \
-scheme sdk-sample \
-archivePath ./archive/sdk-sample.framework-iphonesimulator-arm64.xcarchive \
-sdk iphonesimulator \
SKIP_INSTALL=NO \
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \
xcodebuild -create-xcframework \
-framework './archive/sdk-sample.framework-iphoneos.xcarchive/Products/Library/Frameworks/sdk_sample.framework' \
-framework './archive/sdk-sample.framework-iphonesimulator arm64.xcarchive/Products/Library/Frameworks/sdk_sample.framework' \
-output './MySDK.xcframework'
Package.swift
let package = Package(
name: "MySDK",
platforms: [
.iOS(.v13)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "MySDK",
targets: ["sdk-sample-target"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(
url: "https://github.com/ReactiveX/RxSwift.git",
.upToNextMajor(from: "6.5.0")
)
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
// .bin
.binaryTarget(name: "MySDK", path: "MySDK.xcframework"),
.target(
name: "sdk-sample-target",
dependencies: [
.target(name: "MySDK"),
.product(name: "RxSwift", package: "RxSwift"),
.product(name: "RxCocoa", package: "RxSwift"),
],
path: "Sources"
),
],
swiftLanguageVersions: [
.v5
]
)
RxSwift/RxCocoa/RxBlocking/RxTest version/commit
6.5.0
Platform/Environment
- [ o ] iOS
- macOS
- tvOS
- watchOS
- playgrounds
How easy is to reproduce? (chances of successful reproduce after running the self contained code)
- [ o ] easy, 100% repro
- sometimes, 10%-100%
- hard, 2% - 10%
- extremely hard, %0 - 2%
Xcode version:
14.3.1
Installation method:
- CocoaPods
- Carthage
- Git submodules
- [ o ] SPM
I have multiple versions of Xcode installed:
(so we can know if this is a potential cause of your issue)
- yes (which ones)
- [ o ] 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
- [ 0 ] I have a small code base
- I have a significant code base
Hey @bangkm,
We don't support specific build configuration / etc on this GitHub, only code-related bugs, etc.
I suggest checking out our Slack:
https://join.slack.com/t/rxswift/shared_invite/zt-1uw2ked5y-~76l4~stBMpLbExNQNnZ4Q