WatchOS 2 problem:dyld: Library not loaded

本文解决了一个常见的WatchKitExtension问题:dyld: Library not loaded的错误提示。该问题通常是由于未正确加载所需的framework所导致。解决方法是在Extension target的General->Embedded Binaries中添加对应的framework。文章还解释了如何通过Link binary with libraries及Embed Frameworks来避免类似问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


现象

WatchKit Extension报"dyld:Library not loaded"的错误提示,应该是使用的framework没有加载进去

解决办法

在Extension target -> "General" -> "Embedded Binaries"中添加对应的framework





原因

Link binary with libraries Link frameworks and libraries with your project’s object files to produce a binary file. You can link a target’s source files against libraries in the target’s active SDK or against external libraries.
Embed Frameworks You can create an embedded framework to share code between your app extension and its containing app.
Timeline If your containing app target links to an embedded framework, it must include the arm64 architecture or it will be rejected by the App Store.


在App Extension或者Watch Extension中使用三方SDK,则需要使用Embed Frameworks的格式
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值