Mar*_*tek 5 xcode linker dependencies dyld ios-frameworks
Frameworks在Xcode中使用不同的时,编译器和链接器有时不包含Framework在库中.结果是在启动期间立即崩溃,并显示以下消息:
dyld: Library not loaded: /System/Library/Frameworks/UserNotifications.framework/UserNotifications
Referenced from: /var/containers/Bundle/Application/1D41BD68-9B88-4D5D-B7AB-0D1C31979964/App.app/App
Reason: image not found
Run Code Online (Sandbox Code Playgroud)
我发现了一种避免这种情况的方法.它只是在应用程序代码中直接提到该库的部分,如下所示:
UNNotificationRequest *unr = [UNNotificationRequest alloc];
Run Code Online (Sandbox Code Playgroud)
只包含该框架中的文件#include <UserNotifications/UserNotifications.h>并不能解决问题.也没有@import UserNotifications;
对于不同的ios版本,我已经在不同的xcode版本上看到了不同的库.
以下是另外两个具有更具体用例的问题:
1)在Storyboard中使用的CABTMidiCentralViewController仅在使用代码引用时才有效
2)切换到Xcode 10导致iOS9的UserNotifications.framekwor dyld:Library not loaded crash`
有人知道为什么会这样吗?如何避免代码的愚蠢部分,但仍然链接/嵌入所需的框架?
Always Embed Swift Standard Libraries了YESLink Frameworks Automatically了YESUserNotifications框架的问题:
使用模拟器:
使用真实设备:
当我将框架更改为时,它不会崩溃Required,Optional但推送通知不起作用.
UserNotifications.framework 是一个系统框架,要使用它必须存在于运行应用程序的系统上。它是最近添加的,所以我的猜测是,当在该框架存在之前的旧版 iOS 版本上运行时,您会看到它丢失的错误。
| 归档时间: |
|
| 查看次数: |
188 次 |
| 最近记录: |