问题描述
所有引用的答案均无效. Xcode 10.2发生了一些新变化
None of the referenced answers works. Something new has happened with Xcode 10.2
无论我使用Swift 4.2还是5,都会发生这种情况.
This happens whether or not I use Swift 4.2 or 5.
使用全新的未经编辑的命令行工具,它会立即发生.
It happens immediately with a brand new, unedited command-line tool.
您需要做的就是创建一个MacOS命令行工具,然后点击运行".
All you need to do, is create a MacOS command-line tool, and hit "run."
您会立即收到此错误.
到目前为止,我还没有完成任何修复工作.
Nothing I have done so far has fixed it.
推荐答案
从Xcode 10.2开始,Swift命令行工具需要macOS中的Swift库.从macOS Mojave 10.14.4开始默认包含它们.在macOS Mojave 10.14.3和更早版本中,有一个可选软件包为Swift命令行工具提供这些运行时支持库,您可以从 Apple开发者的更多下载内容.如果您安装了此程序包的Beta版,请用发行版替换它.只有Swift命令行工具才需要此软件包,带有图形用户界面的应用则不需要此软件包.
Starting with Xcode 10.2, Swift command line tools require the Swift libraries in macOS. They’re included by default starting with macOS Mojave 10.14.4. In macOS Mojave 10.14.3 and earlier, there’s an optional package to provide these runtime support libraries for Swift command line tools that you can download from More Downloads for Apple Developers. If you installed the beta version of this package, replace it with the release version. This package is only needed for Swift command line tools, not for apps with graphical user interfaces.
请注意:
- 如果您仍在macOS 10.14.3上,
- 这仅是 必要的.一旦macOS升级到10.14.4,操作系统便会提供Swift运行时库,并且使用Xcode 5创建的命令行工具无需安装"Swift 5 Runtime程序包"即可运行.
- 在具有Xcode 10.2的macOS 10.14.3上,您必须下载并安装 latest "Swift 5 Runtime软件包".您可能已经安装了Xcode 10.2 beta版的较早版本的软件包不起作用.
- Xcode 10.2 Beta发行说明的早期版本建议添加用户定义的设置
SWIFT_FORCE_STATIC_LINK_STDLIB=YES
作为一种解决方法,不再需要.
- This is only necessary if you are still on macOS 10.14.3. As soon as macOS is upgraded to 10.14.4, the Swift runtime libraries are provided by the operating system, and command line tools created with Xcode 5 run without the need to install the "Swift 5 Runtime package."
- On macOS 10.14.3 with Xcode 10.2 you must download and install the latest "Swift 5 Runtime package." An earlier package which you might have installed with an Xcode 10.2 beta release does not work.
- Early versions of the Xcode 10.2 beta release notes recommended to add a user-defined setting
SWIFT_FORCE_STATIC_LINK_STDLIB=YES
as a workaround, that is no longer necessary.
这篇关于dyld:库未加载:@ rpath/libswiftCore.dylib问题与新的Xcode(10.2)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!