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

升级Xcode 16后出现Duplicate -rpath '@executable_path' ignored警告

升级Xcode 16后iOS项目出现Duplicate -rpath '@executable_path' ignored警告问题

升级至Xcode 16后,我的iOS项目出现了Duplicate -rpath '@executable_path' ignored警告。清理项目并删除Derived Data后警告会消失,重新构建也不会出现,但激活预览或在模拟器运行时警告会再次出现;而在真机或Any iOS Device (arm64)上构建/运行则无此警告。

我怀疑是预览或模拟器的问题,但未找到相关线索,且全网未检索到该警告相关信息。当前这个烦人的警告导致预览频繁崩溃,可能二者存在关联。

完整警告命令

cd /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Xcode/MyApp
    /Applications/Xcode.app/Contents/Developer/Toolchains/
codeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target x86_64-apple-ios15.0-simulator -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.0.sdk -O0 -L/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator -Xlinker -rpath -Xlinker @executable_path -Xlinker -rpath -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/PackageFrameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fsanitize\=thread -Xlinker -debug_variant -e ___debug_blank_executor_main -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __debug_dylib -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-DebugDylibPath-normal-x86_64.txt -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __debug_instlnm -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-DebugDylibInstallName-normal-x86_64.txt -Xlinker -filelist -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-ExecutorLinkFileList-normal-x86_64.txt -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __ents_der -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app-Simulated.xcent.der /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp.debug.dylib -o /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

内联版本命令

Ld /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp normal (in target 'MyApp' from project 'MyApp')
cd /Users/username/Library/Mobile\ Documents/com\~apple\~CloudDocs/Xcode/MyApp
    /Applications/Xcode.app/Contents/Developer/Toolchains/
codeDefault.xctoolchain/usr/bin/clang -Xlinker -reproducible -target x86_64-apple-ios15.0-simulator 
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/
iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator18.0.sdk -O0 -L/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator/PackageFrameworks -F/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator -Xlinker -rpath -Xlinker @executable_path
 -Xlinker -rpath -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator/PackageFrameworks -Xlinker -rpath -Xlinker @executable_path
/Frameworks -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker
 -objc_abi_version -Xlinker 2 -fsanitize\=thread -Xlinker -debug_variant -e 
___debug_blank_executor_main -Xlinker -sectcreate -Xlinker __TEXT -Xlinker
 __debug_dylib -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-DebugDylibPath-normal-x86_64.txt
 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __debug_instlnm -Xlinker 
/Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-DebugDylibInstallName-normal-x86_64.txt
 -Xlinker -file list -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp-ExecutorLinkFileList-normal-x86_64.txt
 -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app-Simulated.xcent -Xlinker -sectcreate -Xlinker __TEXT 
-Xlinker __ents_der -Xlinker /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/MyApp.app-Simulated.xcent.der /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp.debug.dylib -o /Users/username/Library/Developer/Xcode/DerivedData/MyApp-gqyiajecvjcgeobbbdpliosrshwu
/Build/Products/Debug-iphonesimulator/MyApp.app/MyApp

我注意到命令中存在两处@executable_path,尝试过以下操作但均无法解决问题:

  • 删除Derived Data
  • 删除Previews文件夹
  • 删除整个Xcode库文件夹

环境信息

  • Xcode 16.1
  • macOS 15.1.1

项目信息

  • 通过Homebrew安装了SwiftLint和SwiftFormat
  • 基于iOS 15开发
  • 使用SwiftPM管理包依赖
  • 近期刚从CocoaPods迁移而来
  • Runpath Search Paths参数为空

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.17 10:54:51