Xcode 9 - 无法发出预编译的标头 [英] Xcode 9 - failed to emit precompiled header

查看:2658
本文介绍了Xcode 9 - 无法发出预编译的标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Objective-C和swift中都有一个项目,只需要 MyProjectName-Bridging-Header.h ,我还配置了Objective-C桥接头。
我还在.pch文件中添加了'MyprojectName-Swift.h'。

I have a project in Objective-C as well as in swift by taking MyProjectName-Bridging-Header.h and i also configured the Objective-C Bridging Header. Also i have added 'MyprojectName-Swift.h' in .pch file.

这在xcode 8.2上运行正常但是当我从xcode 9构建我的项目时我收到以下错误。

This works fine on xcode 8.2 but when i build my project from xcode 9 i am getting the below error.


未能发出预编译的头文件
'/ Library/Developer/Xcode/DerivedData/MyprojectName-lajanjvhqjnfjksdsndsfkads/Build/Intermediates.noindex /PrecompiledHeaders/MyprojectName-Bridging-Header-swift_44AHJm3Z96qu-clang_2BIMGQVXGEZ09.pch'
for bidging header
'/ Files / MyProjectLocaiton/FoneApp-Bridging-Header.h'

failed to emit precompiled header '/Library/Developer/Xcode/DerivedData/MyprojectName-lajanjvhqjnfjksdsndsfkads/Build/Intermediates.noindex/PrecompiledHeaders/MyprojectName-Bridging-Header-swift_44AHJm3Z96qu-clang_2BIMGQVXGEZ09.pch' for bridging header '/Documents/MyProjectLocaiton/FoneApp-Bridging-Header.h'

请帮我解决这个问题。谢谢!

Please help me out from this. Thanks!

推荐答案

最后我得到了这个问题的解决方案。
在我的项目中,前缀标题路径没有明确定义。之前的路径是

Finally i got the solution of this issue. In my project the Prefix Header path is not clearly defined. Earlier the path was


$(SRCROOT)/MyPrefixHeaderFile.pch

$(SRCROOT)/MyPrefixHeaderFile.pch

MyPrefixHeaderFile.pch 位于项目文件夹内的另一个文件夹中,所以我更新前缀标题路径

MyPrefixHeaderFile.pch is in another folder inside the project folder, So i update the Prefix Header path to


$(SRCROOT)/FolderName/MyPrefixHeaderFile.pch

$(SRCROOT)/FolderName/MyPrefixHeaderFile.pch

这篇关于Xcode 9 - 无法发出预编译的标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆