【问题标题】:Xcode 13 will not show PreviewXcode 13 不会显示预览
【发布时间】:2021-12-19 04:06:41
【问题描述】:

我有一台配备 M1 Pro 芯片的全新 21 Macbook Pro。我从应用商店安装了 Xcode,还安装了 Xcode beta。我也完全了解蒙特雷的最新情况。

我正在构建一个 swift UI 应用程序,但我根本无法进行预览。

我收到以下错误。

== PREVIEW UPDATE ERROR:

    MessageSendFailure: Message send failure for send previewInstances message to agent
    
    ==================================
    
    |  RemoteHumanReadableError
    |  
    |  LoadingError: failed to load library at path "/Users/user/Library/Developer/Xcode/DerivedData/Test-gfnknimtrrhvztavjffxvzjvrvmo/Build/Intermediates.noindex/Previews/Test/Intermediates.noindex/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/arm64/SwiftUIView.2.preview-thunk.dylib": Optional(dlopen(/Users/user/Library/Developer/Xcode/DerivedData/Test-gfnknimtrrhvztavjffxvzjvrvmo/Build/Intermediates.noindex/Previews/Test/Intermediates.noindex/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/arm64/SwiftUIView.2.preview-thunk.dylib, 0x0002): tried: '/Users/brandon/Library/Developer/Xcode/DerivedData/Test-gfnknimtrrhvztavjffxvzjvrvmo/Build/Intermediates.noindex/Previews/Test/Products/Debug-iphonesimulator/SwiftUIView.2.preview-thunk.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Users/user/Library/Developer/Xcode/DerivedData/Test-gfnknimtrrhvztavjffxvzjvrvmo/Build/Intermediates.noindex/Previews/Test/Intermediates.noindex/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/arm64/SwiftUIView.2.preview-thunk.dylib' (no such file), '/Users/user/Library/Developer/Xcode/DerivedData/Test-gfnknimtrrhvztavjffxvzjvrvmo/Build/Intermediates.noindex/Previews/Test/Intermediates.noindex/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/arm64/SwiftUIView.2.preview-thunk.dylib' (no such file), '/usr/lib/SwiftUIView.2.preview-thunk.dylib' (no such file))

我已经尝试重新安装 xcode,重启你的名字。

我可以让模拟器工作...

有什么想法吗?

【问题讨论】:

    标签: xcode


    【解决方案1】:

    我遇到了同样的问题,在这里找到了解决方案: https://developer.apple.com/forums/thread/691237

    我没有登录到 GitHub 所以怀疑,它不起作用。

    Xcode 似乎进入了无效状态。我怀疑简单地禁用和启用自动签名可以解决问题,但我还按照帖子中的建议清除了我的项目的 Container 文件夹。

    【讨论】:

      【解决方案2】:

      同样的问题并通过将 Mac 的用户名更改为小写来解决。 用户名->用户名

      【讨论】:

      • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
      【解决方案3】:

      我试过的都没有,包括跑步:

      • sudo xcodebuild -license 在终端中
      • 删除派生数据
      • 再次登录 GitHub
      • 重新启动

      只有当我切换 自动刷新画布(编辑器 > 画布)时,我才能恢复预览。
      新的默认项目的预览也失败了。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-11-02
        • 2015-07-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-07
        相关资源
        最近更新 更多