Missing required module 'RxCocoaRuntime' in xcframework

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.2(14C18)


  1. Create framework project (km-ios-sdk)
  2. Set Build Active Architecture Only YES from NO
  3. Mach-O Type is Dynamic Library
  4. Write simple code using RxSwift, RxCocoa
  5. Create .xcarchive and .xcframework
xcodebuild archive \
-scheme km-ios-sdk \
-archivePath ./archive/km-ios-sdk.framework-iphoneos.xcarchive \
-sdk iphoneos \

xcodebuild archive \
-scheme km-ios-sdk \
-archivePath ./archive/km-ios-sdk.framework-iphonesimulator-arm64.xcarchive \
-sdk iphonesimulator \

xcodebuild -create-xcframework \
-framework './archive/km-ios-sdk.framework-iphoneos.xcarchive/Products/Library/Frameworks/km_ios_sdk.framework' \
-framework './archive/km-ios-sdk.framework-iphonesimulator-arm64.xcarchive/Products/Library/Frameworks/km_ios_sdk.framework' \
-output './KmSDK.xcframework'
  1. Created Package.swift as below and uploaded it to git
  2. download and import km-ios-sdk as spm in the sample app, the error appears
    - Missing required module 'RxCocoaRuntime'

After manually downloading RxCocoaruntime.xcframework from RxSwift Github and embedding it in the framework project, I made xcframework again, but the same error occurs.

Also, I added $(inherited) and $(BUILD_PRODUCTS_DIR)/RxCocoaruntime to Runpath and Framework Search Path in Build Setting, but the same error occurs.

Any solution?

This explains the general problem and a few solutions: Issue with third party dependencies inside a XCFramework through SPM - #3 by NeoNacho