dyld:库未加载:@ rpath/libswiftSwiftOnoneSupport.dylib [英] dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib
问题描述
我已经构建了一个Swift框架,现在我正试图开始构建一个将使用该框架的Swift iOS应用程序.我收到此错误:
I've built a Swift framework and now I'm trying to start building a Swift iOS application that will use that framework. I'm getting this error:
dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib
Referenced from: /Users/tdean/Library/Developer/Xcode/DerivedData/NFLApplication-ejmafvjrlqgjaabggwvadjarjjlg/Build/Products/Debug-iphonesimulator/NFLStatsModel.framework/NFLStatsModel
Reason: image not found
我已经搜索了SO,找到了类似的报告,并尝试了其中列出的修复程序,包括:
I've scoured SO and found similar reports and tried the fixes listed there, including:
- 清除我的DerivedData文件夹
- 重新启动Xcode和iPhone模拟器
- 确保在我的框架和应用程序的构建设置中均设置了
Always Embed Swift Standard Libraries = YES
- 确保在我的框架和应用程序的构建设置中均设置了
Enable Bitcode=NO
- 在我的框架和应用程序的构建设置中均确保将
Runpath Search Paths
设置为@executable_path/Frameworks
- 将Xcode安装中的所有libswift文件复制到项目中的本地副本中,并添加了一个自定义构建阶段,以将这些文件复制到frameworks文件夹中.
- Clearing out my DerivedData folder
- Restarting Xcode and the iPhone simulator
- Ensuring that
Always Embed Swift Standard Libraries = YES
is set, both in my framework and my application's build settings - Ensuring that
Enable Bitcode=NO
is set, both in my framework and my application's build settings - Ensuring that
Runpath Search Paths
is set to@executable_path/Frameworks
, both in my framework and my application's build settings - Copied all the libswift files from my Xcode installation into a local copy within my project, and added a custom build phase to copy those files into the frameworks folder.
在每种情况下,当我尝试运行应用程序时都会遇到相同的错误.
In every case, I get the same error when I try to run my application.
- Xcode版本8.1(8B62)
- Apple Swift版本3.0.1(swiftlang-800.0.58.6 clang-800.0.42.1)
推荐答案
我最终通过混合使用修补程序使它可以正常工作.我不确定是否所有人都需要,但是我在这里记录似乎对我有用的东西,以防万一其他人可以从我发现的东西中受益.
I eventually got this working using a mix of fixes. I'm not sure if all of them are needed, but I'm documenting what seemed to work for me here, just in case anyone else can benefit by what I've found.
- 我已在我的Swift框架和使用该框架的Swift应用程序的构建设置选项卡中将
Always Embed Swift Standard Libraries
的值设置为YES
. - 我已经为我的Swift框架和使用该框架的Swift应用程序的常规"选项卡的链接的框架和库"部分添加了
Foundation.framework
. - 我已将
Foundation.framework
添加到使用该框架的Swift应用程序的常规"选项卡的嵌入式二进制文件"部分.
- I have set
Always Embed Swift Standard Libraries
to a value ofYES
in the build settings tab for both my Swift framework and in the Swift application that uses the framework. - I have added
Foundation.framework
to the Linked Frameworks and Libraries section of the general tab for both my Swift framework and in the Swift application that uses the framework. - I have added
Foundation.framework
to the Embedded Binaries section of the general tab for the Swift application that uses the framework.
在所有这三个设置均已就绪的情况下,我能够构建和运行我的应用程序而不会遇到此错误.
With all 3 of these settings in place, I am able to build and run my application without encountering this error.
这篇关于dyld:库未加载:@ rpath/libswiftSwiftOnoneSupport.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!