Xcode问题:未加载库:@ rpath / libswiftAppKit.dylib [英] Xcode Issue: Library not loaded: @rpath/libswiftAppKit.dylib
问题描述
我已经完成了使用Swift 3在 Cocoa (不是iOS)应用程序上的工作。我已经在台式计算机上对其进行了测试。它工作正常。我已经在另一台台式计算机上对其进行了测试。它工作正常。我什至设法将其发送到 iTunes Connect 。但我尚未提交此文件,因为同一应用程序无法在MacBook Pro(2013)上运行。无论如何,我已经在配备视网膜显示屏的MacBook Pro上进行了测试。那是整个问题开始发生的时候。实际上,该桌面应用程序几天前已在同一台MacBook Pro上运行。我认为还没有沙盒。现在,每次我通过AirDrop将在不同iMac型号上运行的二进制副本发送到MacBook Pro并尝试运行该应用程序时,都会收到错误消息,提示 EXC_CRASH(代码签名无效)
。因此,我已经删除了 Developer
/ Xcode
/ DerviedData内部的一些文件。
现在,我什至无法调试应用程序。当我调试它时,它会挂上一条致命错误消息,这是我从未见过的。
I've finished working on a Cocoa (not iOS) application with Swift 3. I've tested it on a desktop computer. It works fine. I've tested it on another desktop computer. It works fine. I have even managed to send it over to iTunes Connect. But I have not submitted it because the same application fails to run on a MacBook Pro (2013). Anyway, I've tested it on a MacBook Pro with a retina display. That's when the entire problem started happening. Actually, this desktop application ran on the same MacBook Pro a few days ago. I think it was not sandboxed yet. Now, every time I send a binary copy that runs on different iMac models to MacBook Pro through AirDrop and try to run the application, I get an error that says EXC_CRASH (Code Signature Invalid)
. So I've deleted some files inside Developer
/Xcode
/ DerviedData.
Now, I cannot even debug the application. When I debug it, it hangs up with a fatal error message, which I have never seen before.
现在,如果我双击Xcode生成的应用程序,我收到一个崩溃报告,内容为未加载库:@ rpath / libswiftAppKit.dylib 。我以为我可能偶然删除了一些系统文件。但是,如果我调试现有的macOS和iOS应用程序,则运行它们没有问题。幸运的是,整个问题都发生在这个特定的Xcode项目上。
Now, if I double-click on an application that Xcode has generated, I get a crash report that says Library not loaded: @rpath/libswiftAppKit.dylib. I thought that I might have deleted some system files by accident. But if I debug existing macOS and iOS apps, I have no problem running them. Fortunately, the entire problem occurs on this particular Xcode project.
我在这里找到的一个主题建议我们设置始终嵌入Swift标准库 strong>选项设为是。我做到了,没有任何希望。我还阅读了一条建议,内容涉及将开发人员证书上的使用此认证时
选项设置为使用系统默认值
,这无济于事。我尝试过的另一个建议是清除缓存(Command + Shift + Option + K)。
One topic that I've found here suggest that we set the Always Embed Swift Standard Libraries option to Yes. I've done that with no vail. I have also read a suggestion that says something about setting the When using this certification
option on a developer certificate to Use System Defaults
, which doesn't help. Another suggestion that I've tried is clearning cache (Command + Shift + Option + K).
如果您有任何建议,请告诉我。谢谢。
If you have any suggestions, please let me know. Thanks.
更多信息
我也屡次看到奇怪的警报消息在找不到%@ 的MacBook Pro上。当我双击应用程序图标时,会弹出此错误消息。它可能是指
I have also seen a bizarre alert message repeatedly on MacBook Pro that says "%@" cannot be found. This error message poped up when I double-clicked on the application icon. It may refer to
String(format: NSLocalizedString("whatever", comment: ""), variable name)
推荐答案
我已经解决了这个问题!我也有同样的问题但是从 https://www.reddit.com/r/ swift / comments / 4nac9s / using_swift_frameworks_with_command_line / ,我知道键是rpath。
I have solved the problem! I had the same problem with you. But from the answer in https://www.reddit.com/r/swift/comments/4nac9s/using_swift_frameworks_with_command_line/, I have known that the key is the rpath.
所以我尝试将此路径添加到项目中以下两个设置:
So I try to add this path to the project in the following two settings:
${DT_TOOLCHAIN_DIR}/usr/lib/swift/macosx/
- 运行路径搜索路径
- 库搜索路径
我不知道为什么需要同时添加这两个设置,但是它可以工作!
I don't know why need to add both the two settings, but it works!
这篇关于Xcode问题:未加载库:@ rpath / libswiftAppKit.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!