gpt4 book ai didi

ios - Swift 3 迁移后无法在调试器中查看变量值

转载 作者:可可西里 更新时间:2023-11-01 03:58:52 24 4
gpt4 key购买 nike

我们已将我们的 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;清理您的桥接头并确保您只拥有所需的东西。

我遇到了同样的问题,但在 failed to get module 'yyy' from AST context 之后没有输出.我从桥接 header 中删除了所有内容,并逐个添加了项目以确保我需要所有内容。

我发现添加 #import <UIKit/UIKit.h>顶部是必要的(但最初丢失了)并发现了一些我不需要的,因为我更改了我的项目结构并忘记删除了一些包含。毕竟,它开始工作了。希望这会有所帮助。

关于ios - Swift 3 迁移后无法在调试器中查看变量值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40349259/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com