【发布时间】:2021-09-28 09:33:04
【问题描述】:
我有一个 2018 年的 Xcode 项目,它编译时没有任何错误或警告。
(它曾经使用 cocoapods,但我最近通过使用 SPM 导入我的一个依赖项来替换它,从那时起我使用 pod deintegrate 删除了所有 cocoapods 残余)。
无论如何,如果我添加一个简单的
struct TestView: View {
var body: some View {
Text("Hello, World!")
}
}
对于我的项目,SwiftUI 预览将在 8 秒后失败并说:
MessageSendFailure: Message send failure for send render message to agent
==================================
| RemoteHumanReadableError: Could not connect to agent
|
| Bootstrap timeout after 8.0s waiting for connection from 'Identity(pid: 30286, sceneIdentifier: Optional("XcodePreviews-30286-133-static"))' on service com.apple.dt.uv.agent-preview-service
如果我将所有资源和 *.swift 文件移动到新创建的 Xcode 项目中,则 SwiftUI 预览将起作用。
我已经查看了所有可能的 Build Settings 我能想到的,似乎没有一个是造成这种情况的原因。
PS:当然,我已经多次删除了DerivedData 文件夹,因为这通常是我们尝试的第一件事。
【问题讨论】: