每当我尝试使用名为Debug"或Release"以外的构建配置时,Xcode 突然找不到我的 Swift 框架.除了名称之外,这些配置完全相同(实际上,新配置是从工作的调试"配置中复制而来的).
Whenever I try to use a build configuration named other than 'Debug' or 'Release', Xcode suddenly cannot find my Swift frameworks. The configurations are the exact same other than their name (in fact, the new configuration was duplicated from the working 'Debug' configuration).
Xcode 报告没有这样的模块"
Xcode reports 'No such module'
这似乎是一个非常奇怪的错误.肯定有人以前遇到过这种情况吗?我的谷歌搜索没有结果.有谁知道可能导致此问题的原因是什么?我很确定我正确地添加了框架.
This seems like a really strange bug. Surely someone has come across this before? My Google search yielded no results. Does anyone have any idea what may be causing this issue? I'm pretty sure I added the framework correctly.
我创建了一个简短的截屏视频,向您展示我在做什么:http://www.screencast.com/t/zpgZ5ZYgvH
I've created a short screencast to show you exactly what I'm doing: http://www.screencast.com/t/zpgZ5ZYgvH
底线:
您也可以下载示例项目:http://s000.tinyupload.com/?file_id=48797763216274271820
You can also download the sample project: http://s000.tinyupload.com/?file_id=48797763216274271820
我正在运行 Xcode 6.0.1 (6A317) 和 Yosemite 10.10 (14A361c).
I'm running Xcode 6.0.1 (6A317) and Yosemite 10.10 (14A361c).
在目标的Build Settings
中添加以下Framework Search Path
:$(SYMROOT)/Release$(EFFECTIVE_PLATFORM_NAME)
并使其非递归
Add the following Framework Search Path
in the Build Settings
of your target:
$(SYMROOT)/Release$(EFFECTIVE_PLATFORM_NAME)
and make it non-recursive
在我的情况下,这是针对 Alamofire,它作为 git 子模块添加到我的项目中.
In my case this was for Alamofire, which was added to my project as a git submodule.
框架正在正确构建,可以在构建日志中看到,但我假设默认框架搜索路径是从方案名称派生的.Alamofire 框架和dSYM 文件位于 Release-iphoneos
/Release-iphonesimulator
.
The framework was being built correctly which can be seen in the build logs, but I assume the default framework search path is derived from the scheme name. The Alamofire framework & dSYM file are in Release-iphoneos
/ Release-iphonesimulator
.
这应该适用于任何 Swift 框架,只要它的方案名称是默认的.如果没有,请检查构建日志并相应地调整框架搜索路径.
This should work work with any Swift framework as long as it's scheme names are default. If not, check the build logs and adjust the framework search path accordingly.
这篇关于Swift 框架不适用于名为“Debug"或“Release"以外的构建配置:没有这样的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!