找不到 Xcode 7.1 标头
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33361160/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 7.1 header not found
提问by Adnan Munir SE
During archive Xcode 7.1 does says Restkit/Restkit.h
not found but in debug it successfully found the header. It's an old project which do not uses cocoa pods so RestKit is added manually in it. Tried many solutions but not successful. Help required.
在存档期间 Xcode 7.1 确实说Restkit/Restkit.h
未找到,但在调试中它成功找到了标头。这是一个不使用可可豆荚的旧项目,因此在其中手动添加了 RestKit。尝试了很多解决方案但都没有成功。需要帮助。
回答by FeltMarker
Together with your suggestion and this SO postI managed to solve it by adding "$(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers" (recursive) in the project build settings, Header Search Path for Release. Also set Skip Install = YES (build settings/deployment in the RestKit-project) and changed :
连同您的建议和这篇 SO 帖子,我设法通过在项目构建设置、发布的标题搜索路径中添加“$(BUILD_ROOT)/../IntermediateBuildFilesPath/Headers”(递归)来解决它。还设置 Skip Install = YES(在 RestKit 项目中构建设置/部署)并更改:
#import <RestKit/RestKit.h> to "RestKit/RestKit.h"
Note. Check in your xcode preferences/locations tab where the derived data is stored. Default is Unique build location. Then look in Finder for the folder IntermediateBuildFilesPath and search for the headers you are missing. Add this folder to the search path.
笔记。检查存储派生数据的 xcode 首选项/位置选项卡。默认为唯一构建位置。然后在 Finder 中查找文件夹 IntermediateBuildFilesPath 并搜索您缺少的标题。将此文件夹添加到搜索路径。
回答by Jason
I had the same issue. I added the following to the Header Search Paths build settings with non-recursive selected, and it solved my issue:
我遇到过同样的问题。我在选择了非递归的标题搜索路径构建设置中添加了以下内容,它解决了我的问题:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers"
I didn't have to change the import syntax or change any other build settings.
我不必更改导入语法或更改任何其他构建设置。
回答by bojanb89
Changing Header Search Paths to:
将标题搜索路径更改为:
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers" (non-recursive)
was correct way for me, too. For other subprojects, you should change Public headers folder path (Build Settings > Packaging) to
对我来说也是正确的方式。对于其他子项目,您应该将 Public headers 文件夹路径(Build Settings > Packaging)更改为
"../../Headers/$(TARGET_NAME)"
in subproject target's settings.
在子项目目标的设置中。
回答by Nico teWinkel
All of the above answers were part of the solution; however, in my case I ran into a detail that had me confused for a little while.
以上所有答案都是解决方案的一部分;然而,就我而言,我遇到了一个让我困惑了一段时间的细节。
As per the answers above, I also updated the Header Search Paths (under Build Settings) by adding:
根据上面的答案,我还通过添加以下内容更新了标题搜索路径(在构建设置下):
"$(BUILD_DIR)/../IntermediateBuildFilesPath/Headers" (non-recursive)
but that didn't work until I realized...
但这并没有奏效,直到我意识到......
I was only updating the Project, and the Targetwas keeping the old paths.
我只更新了Project,而Target保留了旧路径。
So remember to update the Project pathsAS WELL AS the Target paths.
所以请记住更新项目路径以及目标路径。
ps, I didn't have to change any of the RestKit import statements.
ps,我不必更改任何 RestKit 导入语句。