ios – 在Swift 3迁移后无法在调试器中查看变量值
发布时间:2020-12-14 19:38:12 所属栏目:百科 来源:网络整理
导读:我们已将iOS项目迁移到 Swift 3和Xcode 8.从那时起,调试器无法显示任何变量值.如果我尝试打印变量: p someVar 我收到此错误消息. SchemaManager.h是一个桥接头. (实际的项目名称已被下面的yyy替换): warning: Swift error in module yyy.Debug info from t
我们已将iOS项目迁移到
Swift 3和Xcode 8.从那时起,调试器无法显示任何变量值.如果我尝试打印变量:
p someVar 我收到此错误消息. SchemaManager.h是一个桥接头. (实际的项目名称已被下面的yyy替换): warning: Swift error in module yyy. Debug info from this module will be unavailable in the debugger. error: in auto-import: failed to get module 'yyy' from AST context: /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: note: while building module 'SQLiteMacOSX' imported from /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10: #import <sqlite3.h> ^ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35:10: note: while building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35: #include <stdarg.h> /* Needed for the definition of va_list */ ^ <module-includes>:33:9: note: in file included from <module-includes>:33: #import "util.h" ^ error: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/util.h:107:10: error: 'utmp.h' file not found with <angled> include; use "quotes" instead #include <utmp.h> ^ /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: note: while building module 'SQLiteMacOSX' imported from /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10: #import <sqlite3.h> ^ <module-includes>:1:9: note: in file included from <module-includes>:1: #import "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h" ^ error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk/usr/include/sqlite3.h:35:10: error: could not build module 'Darwin' #include <stdarg.h> /* Needed for the definition of va_list */ ^ /Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h:12:9: note: in file included from /Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h:12: #import "SchemaManager.h" ^ error: /Users/xxx/Documents/yyy/yyy/Common/Model/SchemaManager.h:10:9: error: could not build module 'SQLiteMacOSX' #import <sqlite3.h> ^ error: failed to import bridging header '/Users/xxx/Documents/yyy/yyy/Common/Model/Bridging-Header.h' 核心错误归结为: error: 'utmp.h' file not found 我在其他地方读过,桥接头中的问题可以阻止调试器显示变量值.但我不确定如何解决这个问题. 解决方法
TLDR;清理你的桥接头,确保你只有你需要的.
我遇到了同样的问题,但是在AST上下文中无法获得模块’yyy’之后没有输出.我从桥接标题中删除了所有内容,然后逐个添加项目以确保我需要一切. 我发现添加#import< UIKit / UIKit.h>在顶部是必要的(但最初缺少)并找到一些我不需要的,因为我改变了我的项目结构,忘了删除一些包含.毕竟,它开始工作.希望这会有所帮助. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |