升级到 Xcode 10.0 后无法构建模块“UIKit" [英] Could not build module 'UIKit' after upgrade to Xcode 10.0
问题描述
升级到 Xcode 10.0 后,我的 iOS 项目无法构建.
After upgrading to Xcode 10.0, my iOS project will not build.
与 UIKit 相关的 2 个特定构建时错误是:
The 2 specific buildtime errors are related to UIKit are:
解析问题 ************Prefix.pch:12:13: 无法构建模块'UIKit'
Parse Issue ************Prefix.pch:12:13: Could not build module 'UIKit'
泛型问题/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h:176:88:构建模块时没有名为CIImageOption"的类型或协议从 ************.pch:12 导入的UIKit":
Generics Issue /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIImage.h:176:88: No type or protocol named 'CIImageOption' While building module 'UIKit' imported from ************.pch:12:
第二个错误指向 UIImage.h 标头中的以下代码行.
The second error points to the following line of code in the UIImage.h header.
- (nullable instancetype)initWithImage:(UIImage *)image options:(nullable NSDictionary<CIImageOption, id> *)options NS_AVAILABLE_IOS(5_0);
我已经从目标构建阶段中删除并重新添加了 UIKit,并且我尝试添加了 CoreImage.
I have removed and re-added UIKit from the target Build Phases, and I have tried adding CoreImage.
推荐答案
我在 Xcode 11.1 上遇到了这个问题,我发现它是在我为 Xcode 11.0 安装了错误的 Xcode 命令行工具后发生的,因为我没有找到 11.1版本.
I have this issue for Xcode 11.1 and i found that it happened after i have installed a mistaken Xcode Command line tools for Xcode 11.0 cause i have not found the 11.1 version.
无论如何我已经通过删除新安装的Xcode命令行工具来修复它
Anyway i have fix it by delete the newly installed Xcode Command line tools
1- 完全退出 Xcode
1- Quit Xcode Totally
2- 删除此文件夹并清空垃圾箱
2- Delete this folder And Empty Trash
/Library/Developer/CommandLineTools
/Library/Developer/CommandLineTools
希望这对你也有用
这篇关于升级到 Xcode 10.0 后无法构建模块“UIKit"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!