更新到 Xcode 16 后出现“Duplicate -rpath '@executable_path'被忽略”警告

问题描述 投票:0回答:1

升级到 Xcode 16 后,我收到警告

Duplicate -rpath '@executable_path' ignored
当我清理项目并删除派生数据时,警告消失。即使我构建了它,仍然没有任何警告。但是当我激活预览时,警告再次出现。 我认为预览有问题,但我找不到任何东西。我研究过 到处都是,但我没有在任何地方找到这个警告。没有人遇到过这个警告吗?现在我被这个烦人的警告困住了。而且我的预览经常崩溃。也许这就是原因。

以下是完整警告:

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

当然,我看到 cd 命令有 2

@executable_path
,正如警告所述。我尝试删除派生数据,但没有成功。我尝试删除 Previews 文件夹,但没有成功。我尝试删除整个 Xcode 库文件夹,但再次失败。现在我不知道如何解决。

环境:

  • Xcode 16.1
  • MacOS 15.0

项目:

  • 通过自制软件拥有 SwiftLint 和 SwiftFormat。
  • 是一个iOS应用程序。
  • 通过 SwiftPM 具有包依赖性。
swift xcode preview xcode16
1个回答
0
投票

我找到了解决方案。

  • 首先,转到 Finder 中的项目,然后右键单击
    .xcodeproj
  • Inspect Package Contents
    ,然后删除其中的
    xcuserdata
    。您无需删除
    xcshareddata
  • 您还会看到
    project.xcworkspace
    。为此也做同样的事情。然后警告就消失了。耶!
© www.soinside.com 2019 - 2024. All rights reserved.