# \[BUG\] Can't Load Video SDK Framework from Plugin

**URL:** <https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221>\
**Category:** macOS\
**Created:** [June 27, 2021, 9:02am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221 "2021-06-27T09:02:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_coniglio](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mark\_coniglio](https://devforum.zoom.us/u/mark_coniglio)\
**Post date:** [June 27, 2021, 9:02am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/1 "2021-06-27T09:02:44Z")

</div>

**Description**  
My implementation of the Zoom Video SDK resides in a plugin that is loaded by another app.

- The plugin is linked against all 24 of the Zoom Video SDK libraries (asproxy.framework, cmmlib.framework, etc.) and copies all of these into the Frameworks folder of my plugin.

- I have set the Runpath Search Paths (`@rpath`) in XCode build settings set to `@loader_path/../Frameworks`

Yet the call

```
[[ZMVideoSDK sharedVideoSDK] initialize:initParams]

```

fails with

```
ZMVideoSDKErrors_Load_Module_Error

```

However, if I move all 24 libraries into the Frameworks folder of the _main application_ (i.e., the one that loads the plugin) then the call to `[[ZMVideoSDK sharedVideoSDK] initialize:initParams]` succeeds and everything else works as expected.

It is important to note that calling

```
ZMVideoSDKInitParams *initParams = [[[ZMVideoSDKInitParams alloc] init] autorelease] 

```

works, which actually proves that the Video SDK libraries are being loaded successfully.

**Are you calling [NSBundle mainBundle] in your internal code?**

I have a strong suspicion that you are calling [NSBundle mainBundle] to get a path to one of the Zoom Video SDK libraries in your internal code. Because this ignores the `@rpath`, you end up looking in the Frameworks folder of the main application instead of the Frameworks folder of the plugin.

**Which Desktop Video SDK version?**  
MacOS v1.1.0

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. Create a plugin that uses the Zoom Video SDK that will be loaded by some other app
2. Link against that all 24 of the Zoom Video SDK and ensure they are copied to the Frameworks folder of the plugin (MyPlugin.bundle/Contents/Frameworks)
3. When the plugin is loaded, attempt to init the Video SDK with [[ZMVideoSDK sharedVideoSDK] initialize:initParams]
4. The call returns the error ZMVideoSDKErrors\_Load\_Module\_Error

**Device (please complete the following information):**

- Device: Apple MacBook Pro 15"
- OS: macOS Mojave 10.13

**Additional context**

Thinking that you might be using the working directory, I tried changing the working directory to the plugin’s dylib, the plugin’s Frameworks folder and other paths related to the plugin. This did not prevent the error.

In addition, I have logging enabled for library loading this appears in the console output, showing that the libraries are actually being loaded upon calling [[ZMVideoSDKInitParams alloc] init]

dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/Zoom Instant Receiver  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/viper.framework/Versions/A/viper  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/tp.framework/Versions/A/tp  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/asproxy.framework/Versions/A/asproxy  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/protobuf.framework/Versions/A/protobuf  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/libssl.dylib  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/libminizip.dylib  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/curl64.framework/Versions/A/curl64  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/nydus.framework/Versions/A/nydus  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/libcrypto.dylib  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/util.framework/Versions/A/util  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/xmpp\_framework.framework/Versions/A/xmpp\_framework  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/VideoSDK.dylib  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/cmmlib.framework/Versions/A/cmmlib  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/ZMVideoSDK.framework/Versions/A/ZMVideoSDK  
dyld: loaded: /Library/Application Support/XXXXXXX/XXXXXXXPlugins\_x64/Zoom Instant Receiver.izzyplug/Contents/MacOS/…/Frameworks/libjson.dylib

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 28, 2021, 9:26pm UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/2 "2021-06-28T21:26:02Z")

</div>

Hi @mark_coniglio, thanks for the post.

It is entirely possible that your suspicions are correct, but there are some other potential causes of this behavior. Due to the complex structure of the SDK, it is also possible to import the SDK incorrectly in such a way that only certain areas of functionality will misbehave. Can you provide a screenshot of the SDK files in your project’s Build Phases in Xcode?

Thanks!

---

<div class="post-metadata">

**Author:** ![mark\_coniglio](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mark\_coniglio](https://devforum.zoom.us/u/mark_coniglio)\
**Post date:** [June 30, 2021, 11:01am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/3 "2021-06-30T11:01:26Z")

</div>

@jon.zoom

Here’s the screenshot of the libraries.

 ![Screen Shot 2021-06-30 at 12.54.58 PM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/4/8/484472269b30eb56f52c370afad991af197f94fd.jpeg)

As you can see, all the libraries are there in the Frameworks folder of my plugin:

 ![plugin-bundle](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/b/7/b7479ec236174f4bbb2bb9bb83258a21dbd84bab.jpeg)

In this configuration, the call `ZMVideoSDKInitParams *initParams = [[[ZMVideoSDKInitParams alloc] init] autorelease]` works as expected.

But when I call `[[ZMVideoSDK sharedVideoSDK] initialize:initParams]` it returns ZMVideoSDKErrors\_Load\_Module\_Error

**HOWEVER** if I simply copy all 24 of those dylibs/Framworks/bundles from the plugin’s Frameworks folder to the Frameworks folder of the app that is _loading_ the plugin, then everything works – the session opens, I can send video, etc. etc…

Best Wishes,  
Mark

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [June 30, 2021, 5:16pm UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/4 "2021-06-30T17:16:32Z")

</div>

Hi @mark_coniglio,

Thanks for providing those screenshots. Can you please also confirm that you have also linked the binaries of the files listed in our documentation [here](https://marketplace.zoom.us/docs/sdk/video/macos/getting-started/integrate#import-sdk)?

Thanks!

---

<div class="post-metadata">

**Author:** ![mark\_coniglio](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mark\_coniglio](https://devforum.zoom.us/u/mark_coniglio)\
**Post date:** [July 1, 2021, 6:54am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/5 "2021-07-01T06:54:38Z")

</div>

@jon.zoom

Dear Jon,

Thanks for pointing me to the link about the prerequisites for building on macOS. I had totally missed the bit about which libraries to include and which ones **not** too, i.e:

> Select your project and navigate to the **Build Phases** tab. Open **Link Binary With Libraries** and ensure that only the follow SDK files are present:
> 
> - libjson.dylib
> - libssl.dylib
> - libminizip.dylib
> - libcrypto.dylib
> - ZMVideoSDK.framework
> - ZMVideoSDK.dylib

Sadly, following this prerequisite didn’t solve the problem.

1. I deleted all of the Zoom SDK libraries and frameworks from my app’s Frameworks folder.
2. Checked that I was copying all 24 of those libraries to my **plugin’s** Frameworks folder
3. Changed the “Link Binaries with Libraries” to include only the libraries listed above as shown in the screen shot below.

**NOTE** There is no library called ZMVideoSDK.dylib as listed in your requirements. I assume you mean VideoSDK.dylib which is in the 1.10 release.

![link-binary-with-libraries](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/d/3/d3aa55794948db6e46a660c6076b1746b40d26c7.png)

The error remains the same. When I execute the code below, I still get the `ZMVideoSDKErrors_Load_Module_Error` error.

```
ZMVideoSDKInitParams *initParams = [[[ZMVideoSDKInitParams alloc] init] autorelease];
// set domain
initParams.domain = @"https://zoom.us";
// set raw data memory mode
initParams.audioRawDataMemoryMode = ZMVideoSDKRawDataMemoryMode_Stack;
initParams.videoRawDataMemoryMode = ZMVideoSDKRawDataMemoryMode_Stack;
initParams.shareRawDataMemoryMode = ZMVideoSDKRawDataMemoryMode_Stack;
// set to enable indirect raw data
// set to enable SDK logging
initParams.enableLog = true;
// set to specify the prefix of the log file name
initParams.logFilePrefix = @"prefix";
NSDebugLog(@"Zoom SDK Param Initialized");

NSDebugLog(@"About to Init Zoom SDK");
ZMVideoSDKErrors zoomErr = [[ZMVideoSDK sharedVideoSDK] initialize:initParams];
NSDebugLog(@"Init Zoom SDK Complete - Error = %d / %s", (int) zoomErr, ZMVideoSDKErrorToName(zoomErr));

```

As a further test, I did the following:

1. Removed the phase that copied all of the Zoom Libraries to my plugin’s Framework’s folder. In other words, my plugin’s Frameworks folder was empty.
2. Restored the 24 zoom libraries to my application’s Framework’s folder.
3. Ran the app that uses the plugin

Upon doing this, the plugin works.

I believe this serves as pretty strong proof that your libraries are not respecting the value of @rpath (again, it’s set to `@loader_path/../Frameworks` as shown in the screen capture below.)

 ![run-path](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/5/65f80b45fff61f969457d58eee87fd5847c00851.png)

Thanks for the continued support,  
Mark

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [July 2, 2021, 12:54am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/6 "2021-07-02T00:54:16Z")

</div>

Hi @mark_coniglio,

Thanks for giving that a try. Also regarding the incorrect dylib name, I submitted a ticket to our documentation team to have that corrected, thank you for pointing that out!

Based on the information you have provided, I think you may be correct. We will need to investigate this and let you know as soon as we have any updates.

Thanks!

---

<div class="post-metadata">

**Author:** ![mark\_coniglio](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mark\_coniglio](https://devforum.zoom.us/u/mark_coniglio)\
**Post date:** [July 2, 2021, 9:01am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/7 "2021-07-02T09:01:51Z")

</div>

@jon.zoom

Dear Jon,

I spent quite a few hours with install\_name\_tool trying to adjust the rpaths entries of your code to attempt to get them to load. But I could not find a solution.

Since your team is going to look into this, I would humbly suggest that you reconfigure things so that all of those extra libraries reside in a Frameworks folder within the ZMVideoSDK framework. Like this

ZMVideoSDK.framework  
– Versions  
– – A  
– – – Headers  
– – – Modules  
– – – Resources  
– – – **Frameworks**  
– – – – the 23 additional libraries  
– – – ZMVideoSDK

This would make things so much cleaner: to work with the Zoom SDK, developers would only need link with the one framework, and also would need to copy only the ZMVideoSDK.framework to their app or plugins Frameworks folder.

Given that the ZMVideoSDK shows this in otool:

```
Load command 20
cmd LC_RPATH
cmdsize 40
path @loader_path/Frameworks (offset 12)

```

It seems like someone was already thinking in this direction. 😉

Best Wishes,  
Mark

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [July 2, 2021, 9:01pm UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/8 "2021-07-02T21:01:22Z")

</div>

Hi @mark_coniglio,

Thanks for the suggestion! We have actually discussed making the process of adding the SDK to a project in Xcode easier, but have not been able to improve that experience just yet. 🙂

I will be sure to let you know if we are able to identify any workarounds for this, but I’m assuming that this will require an update to the SDK to fully resolve. Either way, I will be sure to keep you updated!

Thanks!

---

<div class="post-metadata">

**Author:** ![mark\_coniglio](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@mark\_coniglio](https://devforum.zoom.us/u/mark_coniglio)\
**Post date:** [July 3, 2021, 9:19am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/9 "2021-07-03T09:19:05Z")

</div>

@jon.zoom

Thanks for pursuing this.

For what it’s worth: not being one to give up, I made one last attempt to get these libraries out of the main app, I wrote a script to go through every one and use install\_name\_tool to change any reference to @rpath to a fixed path that was not within the app. The result was the same: the Framework loaded, but calling initialize resulted in `ZMVideoSDKErrors_Load_Module_Error`.

I can’t give my plugins to the testing team until this problem is addressed. So I’m hoping an update can come soon.

Best Wishes,  
Mark

---

<div class="post-metadata">

**Author:** ![jon.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jon.zoom/32/13495_2.png) [@jon.zoom](https://devforum.zoom.us/u/jon.zoom)\
**Post date:** [July 6, 2021, 7:06pm UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/10 "2021-07-06T19:06:56Z")

</div>

Hi @mark_coniglio,

Thanks for the update. We are still looking into this, but it is possible that this will require an SDK update to resolve. I will keep you updated as soon as we have any definite information.

Thanks!

---

<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:** [August 6, 2021, 5:07am UTC](https://devforum.zoom.us/t/bug-cant-load-video-sdk-framework-from-plugin/53221/11 "2021-08-06T05:07:05Z")

</div>

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