使用Canvas预览SwiftUI视图时出错



当我尝试在Xcode的Canvas窗口中预览SwiftUI视图时,我的项目成功构建,但在Canvas窗口出现以下错误:

UVIntegration.DTXMessageError.messageRepliedWithError("正在连接到已启动交互式代理6310",可选(错误域=com.apple.dt.ultraviolet.service代码=17"connectToPreviewHost:未能连接到6310:错误域=RemoteBundleLoaderErrorCode=17"加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号"UserInfo={NSLocalizedDescription=加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号}"UserInfo={NSLocalizedDescription=connectToPreviewHost:未能连接到6310:错误域=RemoteBundleLoader错误代码=17"失败加载库/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号"UserInfo={NSLocalizedDescription=加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号}}((


GenericHumanReadableError:发生意外错误messageRepliedWithError("正在连接到启动的交互式代理6310",可选(错误域=com.apple.dt.xcodepreviews.serviceCode=17"connectToPreviewHost:无法连接到6310:错误Domain=RemoteBundleLoader错误代码=17"加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号"UserInfo={NSLocalizedDescription=加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号}"UserInfo={NSLocalizedDescription=connectToPreviewHost:未能连接到6310:错误域=RemoteBundleLoader错误代码=17"失败加载库/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号"UserInfo={NSLocalizedDescription=加载库失败/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/DDeveloper/Library/PrivateFrameworks/XCPreviewKit.framework/Versions/Current/XPreviewKit由于缺少引导符号{}((

清理构建文件夹,然后杀死Xcode,启动Xcode,进行完整的构建可能(有时(会解决问题。然后整个马戏团又开始表演了。我觉得这对苹果来说有点丢脸。最令人沮丧的是(至少对我来说(文档实际上是不存在的。这都是试错。大部分是错误。

我已经遇到过两次这个问题。我没有一个简单的解决方案,但只有当macOS Catalina的软件更新可用时,它才会发生。例如,现在我使用的是10.15.5,但有10.15.6的更新,我遇到了这个问题。

希望这会有所帮助,而且错误不仅仅是说";更新您的macOS";或者什么的。

最新更新