Description
Our company has been given permission to bundle the Zoom SDK within our own SDK. We were able to successfully bundle the XCFramework into our Swift Package, however, we are having trouble with MobileRTCResources.bundle
. Below is an example of our Package.swift
file:
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "OurPackage",
platforms: [.iOS(.v12)],
products: [
.library(
name: "OurPackage",
targets: ["OurPackage", "MobileRTC"]),
],
dependencies: [
...
],
targets: [
.target(
name: "OurPackage",
dependencies: [...],
resources: [
.copy("MobileRTCResources.bundle")]),
.binaryTarget(
name: "MobileRTC",
path: "MobileRTC.xcframework"
)
]
)
However, when we add this package as a dependency in a sample app and try to initialize the Zoom SDK, the app crashes because it cannot find the MobileRTCResources.bundle
file. When initializing the SDK, the follow crash occurs:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle initWithURL:]: nil URL argument'
If I manually add the bundle file to the Copy Bundle Resources
build phase, the app won’t crash; however, having to do this manual step is not ideal since we would ideally like clients to be able to simply add our Swift Package without having to do any other manual project setup.
Would it be possible to modify the Zoom SDK so it works when bundled in a swift package? This link may help: Apple Developer Documentation