ld: 警告: 找不到选项 '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator' 的目录

ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator'

我的项目有问题 运行 Xcode previews。一旦我尝试启动它,无论我尝试预览的视图如何,我都会收到以下错误。 运行 应用程序在物理设备或模拟器上运行正常。

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

----------------------------------------

LinkDylibError: Failed to build CustomTextField.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 arm64:
  "___llvm_profile_runtime", referenced from:
      ___llvm_profile_runtime_user in FBLPromises(PromisesObjC-dummy.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+All.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Always.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Any.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Async.o)
      ___llvm_profile_runtime_user in FBLPromises(FBLPromise+Catch.o)
      ...
     (maybe you meant: ___llvm_profile_runtime_user)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我已经尝试重新整合 pods 并删除 Framework Search Paths,因为 -F 选项在上述错误中提示了它。这没有带来任何成功。

我有一个类似的问题并通过将 -fprofile-instr-generate 添加到 Build Settings > Linking > Other Linker Flags

来解决