升级到 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 库文件夹,但再次失败。现在我不知道如何解决。
环境:
项目:
我找到了解决方案。
.xcodeproj
。Inspect Package Contents
,然后删除其中的xcuserdata
。您无需删除xcshareddata
。project.xcworkspace
。为此也做同样的事情。然后警告就消失了。耶!