• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 无法构建 Objective-C 模块 'CoreGraphics'

[复制链接]
菜鸟教程小白 发表于 2022-12-11 19:02:57 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我在尝试运行任何单元或 UI 测试时遇到以下错误。运行应用程序本身时不会发生。错误信息如下所示:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:10: note: while building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:
#include <CoreFoundation/CFBase.h>
     ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/CoreFoundation.h"
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
#include <CoreFoundation/CFBase.h>
     ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
#include <Block.h>
     ^
/Users/eirik/Documents/Utvikling/iOS/ProsjekterSamarbeid/AnchorPoint Fishing as/FerskFiskiOS/Pods/leveldb-library/table/Block.h:10:10: note: in file included from /Users/eirik/Documents/Utvikling/iOS/ProsjekterSamarbeid/AnchorPoint Fishing as/FerskFiskiOS/Pods/leveldb-library/table/Block.h:10:
#include "leveldb/iterator.h"
     ^
/Users/eirik/Documents/Utvikling/iOS/ProsjekterSamarbeid/AnchorPoint Fishing as/FerskFiskiOS/Pods/leveldb-library/include/leveldb/iterator.h:18:10: note: in file included from /Users/eirik/Documents/Utvikling/iOS/ProsjekterSamarbeid/AnchorPoint Fishing as/FerskFiskiOS/Pods/leveldb-library/include/leveldb/iterator.h:18:
#include "leveldb/slice.h"

/Users/eirik/Documents/Utvikling/iOS/ProsjekterSamarbeid/AnchorPoint Fishing as/FerskFiskiOS/Pods/leveldb-library/include/leveldb/slice.h:21:10: error: 'string' file not found
#include <string>
     ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/CoreGraphics.h"
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:8:
#include <CoreGraphics/CGBase.h>
     ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.0.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h:12:10: error: could not build module 'CoreFoundation'
#include <CoreFoundation/CFBase.h>
     ^
<unknown>:0: error: could not build Objective-C module 'CoreGraphics'

我在 Swift 3.2 模式和 CocoaPods 中使用 Xcode 9。我正在使用 Firebase 和 FirebaseUI,它具有 leveldb 作为依赖项。可以看到错误首先在leveldb/slice.h中触发,找不到string文件。

到目前为止,我已经尝试了以下方法:

  • 清理(Shift + CMD + K)
  • 移除 DerivedData
  • 清理构建文件夹...
  • 在build设置的框架模块中允许非模块化包含。
  • pod deintegrate, pod clean pod install.

对于它的值(value),这是问题导航器中的错误: Error in Issue Navigator

有什么建议吗?



Best Answer-推荐答案


这看起来类似于 CocoaPods issue这已在 CocoaPods 1.4.0 中修复。没有为单元测试目标正确设置搜索路径。

尝试更新到 CocoaPods 1.4.0 beta 并重新运行 pod update

使用与所描述的here 类似的解决方法对于 leveldb 路径:

仅在 Build Settings -> Header Search Paths

下将 "${PODS_ROOT}/leveldb-library/include" 添加到您的测试目标

关于ios - 无法构建 Objective-C 模块 'CoreGraphics',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46871673/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap