2

How to fix "dyld: Library not loaded @rpath" error

 9 months ago
source link: https://sarunw.com/posts/how-to-fix-dyld-library-not-loaded-error/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How to fix "dyld: Library not loaded @rpath" error

27 Jul 2023 ⋅ 1 min read ⋅ Xcode Debugging

Table of Contents

If you are using a third-party framework in your project and getting the following error on launch, I can share one solution that solves the problem for me.

dyld: Library not loaded: @rpath/FrameworkName.framework/FrameworkName

Referenced from: <067E26D4-XXXX-YYYY-ZZZZ-7C89CFBE81CB> /private/var/containers/Bundle/Application/067E26D4-XXXX-YYYY-ZZZZ-7C89CFBE81CB/AppName.app/AppName

Reason: tried: '/usr/lib/swift/FrameworkName.framework/FrameworkName' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/FrameworkName.framework/FrameworkName' (errno=2)
...

There might be several reasons that cause this error. I will share one reason in this article.

Cause of the problem

This error happened when you linked a Dynamic Library in your project but didn't ship (embed) the framework with the final application package.

As a result, a dynamic linker (dyld) complains that it can't find the framework.

You can easily support sarunw.com by checking out this sponsor.

AI Paraphrase:

Sponsor sarunw.com and reach thousands of iOS developers.

How to fix "dyld: Library not loaded @rpath" error

The solution for this is easy. You need to embed the framework together with the application package.

To do that.

  1. Select your app target.
  2. Select "General" tab.
  3. Scroll down to the "Framework, Libraries, and Embedded Content" section.
  4. Make sure your framework is "Embed & Sign".
Embed & Sign.

Embed & Sign.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK