简体   繁体   English

编译项目时出现Xcode错误

[英]Xcode error while compiling the project

My Xcode project was running all good, I connected my iPhone to transfer the build and since then I am getting these errors我的 Xcode 项目运行良好,我连接了我的 iPhone 来传输构建,从那时起我收到了这些错误

Unknown type name CGContextRef in file CGBitmapContext.h文件 CGBitmapContext.h 中的未知类型名称 CGContextRef

I have been unable to solve this for sometime now.我已经有一段时间无法解决这个问题了。

Core Graphics, where the CG* stuff is defined, is imported by UIKit, so add this line:定义 CG* 内容的 Core Graphics 由 UIKit 导入,因此添加以下行:

#import <UIKit/UIKit.h>

in the offending file在违规文件中

Try to clean derived data in Xcode.尝试清理 Xcode 中的派生数据。 Xcode- Preferences - Locations - Derived Data - You must delete derived data from there. Xcode-首选项-位置-派生数据-您必须从那里删除派生数据。 And clean project.和干净的项目。

Faced the issue in Xcode 11.3.在 Xcode 11.3 中遇到了这个问题。 Done everything related to derived data clear, pod remove and everything available on internet but no luck and the app was not debugging on real device.完成了与派生数据清除、pod 删除以及 Internet 上可用的所有内容相关的所有工作,但没有运气,并且该应用程序未在真实设备上进行调试。 Then thought that it could be the issue of Xcode crash, just removed the Xcode to trash and cleared the trash and then reinstalled the fresh copy of Xcode 11.3.然后想到可能是Xcode崩溃的问题,就将Xcode删除到垃圾箱并清除垃圾箱,然后重新安装Xcode 11.3的新副本。 It worked for me, thanks to my assumption.由于我的假设,它对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM