Fixing Duplicate -rpath '@ executable_path' ignored Warning in Xcode 16
Автор: vlogommentary
Загружено: 2026-01-02
Просмотров: 0
Learn how to resolve the annoying `Duplicate -rpath '@ executable_path' ignored` warning in Xcode 16, especially for simulator and preview builds with Thread Sanitizer enabled.
---
This video is based on the question https://stackoverflow.com/q/79071483/ asked by the user 'Radioactive' ( https://stackoverflow.com/u/18834815/ ) and on the answer https://stackoverflow.com/a/79404246/ provided by the user 'hungri-yeti' ( https://stackoverflow.com/u/5768505/ ) at 'Stack Overflow' website. Thanks to these great users and Stackexchange community for their contributions.
Visit these links for original content and any more details, such as alternate solutions, latest updates/developments on topic, comments, revision history etc. For example, the original title of the Question was: "Duplicate -rpath '@ executable_path' ignored" warning after updating to Xcode 16
Also, Content (except music) licensed under CC BY-SA https://meta.stackexchange.com/help/l...
The original Question post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license, and the original Answer post is licensed under the 'CC BY-SA 4.0' ( https://creativecommons.org/licenses/... ) license.
If anything seems off to you, please feel free to drop me a comment under this video.
---
Introduction
After upgrading to Xcode 16, many developers encounter the warning:
[[See Video to Reveal this Text or Code Snippet]]
This warning typically appears when building for the iOS Simulator or activating SwiftUI previews, but notably does not appear when running on a physical device. It can cause preview crashes and general annoyance during local development.
What's Causing the Warning?
The root cause is usually related to Thread Sanitizer (TSan) being enabled in your build scheme. TSan adds extra runtime checks for threading bugs, which affects the linker flags and can lead to duplicated runtime search paths (-rpath), triggering this warning.
Key observations:
The warning disappears after cleaning the project and deleting derived data temporarily.
It reappears when previews or simulators are triggered.
It only appears with simulators or previews, not on real devices.
The project may have an empty Runpath Search Paths in build settings.
How to Fix It
Step 1: Disable Thread Sanitizer in Your Scheme
Open your project in Xcode.
Select your target scheme (top toolbar).
Click Edit Scheme....
Under the Run section, go to the Diagnostics tab.
Uncheck Thread Sanitizer.
Disabling Thread Sanitizer removes the conflicting linker flags causing the duplicate -rpath warning.
Step 2: Clean and Rebuild
Clean the build folder (Shift + Command + K).
Delete derived data (via Xcode Preferences Locations Derived Data, click arrow, then delete folder).
Rebuild your project.
Why Does This Work?
Thread Sanitizer injects runtime checks and adjusts linker flags like -rpath. When combined with the simulator/previews, these flags get duplicated, causing the warning. Disabling it avoids adding those flags during local builds.
Additional Tips
This warning is harmless and only present in debugging scenarios, not in App Store or release builds.
If you need Thread Sanitizer for debugging, consider toggling it on only when explicitly testing threading issues.
Keep your project's Runpath Search Paths clean to avoid introducing manual duplicates.
Summary
The Duplicate -rpath '@ executable_path' ignored warning in Xcode 16 simulator and preview builds often stems from Thread Sanitizer being enabled. Disabling Thread Sanitizer in your scheme's diagnostics settings eliminates the warning and reduces preview crashes, without affecting release builds.
This simple fix improves the development experience after migrating to Xcode 16.
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: