小编Eug*_*e P的帖子

带有框架的模块化应用程序中的 Swift UI 预览

在我的框架内运行SwiftUI视图预览时遇到问题。\n这是一个项目结构。在此输入图像描述

\n

主目标(ContentViewGradientView)中的 SwiftUI 视图预览按预期工作。

\n

但是,当我\xe2\x80\x99m 尝试预览UI.xcodeprojectSwiftUIView )内的视图时,我\xe2\x80\x99m 收到错误

\n

在此输入图像描述

\n
PotentialCrashError: Update failed\n\nXCPreviewAgent may have crashed. Check ~/Library/Logs/DiagnosticReports for any crash logs from your application.\n\n==================================\n\n|  RemoteHumanReadableError\n|  \n|  LoadingError: failed to load library at path "/Users/yevgeniy/Library/Developer/Xcode/DerivedData/Hackathon-abjguuvpzyisdncwvpeguazdifiu/Build/Intermediates.noindex/Previews/Hackathon/Intermediates.noindex/UI.build/Debug-iphonesimulator/UI.build/Objects-normal/x86_64/SwiftUIView.1.preview-thunk.dylib": Optional(dlopen(/Users/yevgeniy/Library/Developer/Xcode/DerivedData/Hackathon-abjguuvpzyisdncwvpeguazdifiu/Build/Intermediates.noindex/Previews/Hackathon/Intermediates.noindex/UI.build/Debug-iphonesimulator/UI.build/Objects-normal/x86_64/SwiftUIView.1.preview-thunk.dylib, 0x0002): tried: \'/Users/yevgeniy/Library/Developer/Xcode/DerivedData/Hackathon-abjguuvpzyisdncwvpeguazdifiu/Build/Intermediates.noindex/Previews/Hackathon/Products/Debug-iphonesimulator/SwiftUIView.1.preview-thunk.dylib\' (errno=2), \'/Applications/Xcode_14.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Users/yevgeniy/Library/Developer/Xcode/DerivedData/Hackathon-abjguuvpzyisdncwvpeguazdifiu/Build/Intermediates.noindex/Previews/Hackathon/Intermediates.noindex/UI.build/Debug-iphonesimulator/UI.build/Objects-normal/x86_64/SwiftUIView.1.preview-thunk.dylib\' (errno=2), \'/Users/yevgeniy/Library/Developer/Xcode/DerivedData/Hackathon-abjguuvpzyisdncwvpeguazdifiu/Build/Intermediates.noindex/Previews/Hackathon/Intermediates.noindex/UI.build/Debug-iphonesimulator/UI.build/Objects-normal/x86_64/SwiftUIView.1.preview-thunk.dylib\' (mach-o file, but is an incompatible architecture (have \'x86_64\', need \'arm64\')))\n|  \n|  ==================================\n|  \n|  |  MessageSendFailure: Message send failure for <ServiceMessage 115: update>\n
Run Code Online (Sandbox Code Playgroud)\n

~/Library/Logs/DiagnosticReports 文件夹为空。

\n

在 …

swiftui swiftui-previews

6
推荐指数
1
解决办法
1014
查看次数

标签 统计

swiftui ×1

swiftui-previews ×1