After upgrading to Xcode 16, I got the warning Duplicate -rpath '@executable_path' ignored
. The warning disappears when I clean the project and delete the derived data. Even after I built it, there is still no warning. But the warning reappears when I activate the previews or run it on a simulator. But the warning doesn't appear when I build/run with a real device or Any iOS Device (arm64)
.
I think something is wrong with the preview or simulator, but I couldn't find anything. I researched everywhere, but I didn't find this warning anywhere. Did no one come across this warning?
Now I'm stuck with this annoying warning. And my preview was crashing a lot. Maybe this is the reason.
Here is the full warning:
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
This is the inline version so you can see it more easily:
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
I saw that the cd
command had 2 @executable_path
as the warning says, of course. I tried to delete the derived data, but it didn't work. I tried to delete the Previews folder, but it didn't work. I tried to delete the entire Xcode library folder, but it didn't work, again. Now, I don't know how to fix it.
Environment:
Project:
Runpath Search Paths
parameter is empty.I ran into this same error for both macOS and iOS targets, tracked it down to the Thread Sanitizer being enabled in those schemes. Toggle it off, the warning goes away. Since it's due to a debugging sanitizer, I assume that this is not an issue at all in AppStore builds, only local builds.