# Bundling The Zoom SDK Within A Swift Package

**URL:** <https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400>\
**Category:** iOS\
**Created:** [April 20, 2021, 1:43pm UTC](https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400 "2021-04-20T13:43:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbianchi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/dbianchi/32/3122_2.png) [@dbianchi](https://devforum.zoom.us/u/dbianchi)\
**Post date:** [April 20, 2021, 1:43pm UTC](https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400/1 "2021-04-20T13:43:00Z")

</div>

**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:

```auto
// 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:

```auto
***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](https://developer.apple.com/documentation/swift_packages/bundling_resources_with_a_swift_package)

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [April 20, 2021, 5:57pm UTC](https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400/2 "2021-04-20T17:57:21Z")

</div>

Hey @dbianchi,

Thanks for using the dev forum!

I understand the issue here. In an ideal scenario, it would be nice if the SDK could be provided as a swift package itself. It took quite a while to move away from the Fat frameworks to an XCFramework, but there are ongoing efforts to update to best practices. I will submit an internal feature request for this one and let you know what I hear. I am happy, though, that it works in a swift package in some way.

Stay tuned.  
Thanks!  
Michael

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [May 21, 2021, 3:57am UTC](https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400/3 "2021-05-21T03:57:38Z")

</div>

Closed on May 21, 2021, 3:57am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Michael\_Condon](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael_condon/32/13543_2.png) [@Michael\_Condon](https://devforum.zoom.us/u/Michael_Condon)\
**Post date:** [May 21, 2021, 6:03pm UTC](https://devforum.zoom.us/t/bundling-the-zoom-sdk-within-a-swift-package/48400/4 "2021-05-21T18:03:14Z")

</div>

Hey @dbianchi,

After some discussions with the engineering team, we have decided to not implement this change as it only applies to a niche scenario and has SDK size impacts.

Thanks!  
Michael
