You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

UIKit项目中SwiftUI Preview构建失败问题求助

SwiftUI预览更新失败:无法构建SwiftUIView.swift

项目基于UIKit框架,新增SwiftUI文件后,代码可正常编译运行,但SwiftUI预览无法显示,报错信息如下:

LinkDylibError: Failed to build SwiftUIView.swift

Linking failed: linker command failed with exit code 1 (use -v to see invocation)

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'
Undefined symbols for architecture x86_64:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in MMMCommonCore(MMMNetworkConditioner-0a5a65b36dec9cde1cfd7accf33679dd.o)
      ___llvm_profile_runtime_user in MMMCommonCore(MMMWeakProxy.o)
      ___llvm_profile_runtime_user in MMMCommonCore(MMMCommonCore-dummy.o)
      ___llvm_profile_runtime_user in MMMCommonCore(MMMCommonCore-3ab87d8094d35167218084cd0a765a4e.o)
      ___llvm_profile_runtime_user in MMMCommonCore(ArrayBuilder.o)
      ___llvm_profile_runtime_user in MMMCommonCore(CommonCore.o)
      ___llvm_profile_runtime_user in MMMCommonCore(MMMTimeSource.o)
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


==================================

|  BuildInvocationError

已尝试苹果开发者论坛及相关StackOverflow问题中的多种解决方案,均无效。

内容的提问来源于stack exchange,提问作者iceiscold

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 04:39:59