Error “No such file or directory“ for 3rd Party Libraries
See how to fix the “No Such File or Directory“ error in Xcode. It can be frustrating to debug since it can have multiple causes.
• 1 min read
Error
No such file or directory
Complete error:
/Users/<user>/Library/Developer/Xcode/DerivedData/<project>/Build/Products/Development-iphoneos/<library>.bundle: No such file or directory
Problem
This error can be really frustrating to debug, and so it was for me ;)
In my case XCode thrown this error on some SPM packages, which was so confusing.
After some research I found out that the problem was related to the naming of the project configurations.
In this project I am using .xccongif
files to configure the environments and this caused the problem.
Solution
So, the fix is really simple if this is your case.
You just need to change the configuration name with the same name of your .xcconfig
file.
TL;DR
Under the DerivedData/<project>/Build/Products
folder you will see all your builds for each environment.
In my case, Xcode was building the SPM libraries in the wrong folder, Debug-iphoneos
but it should be building them inside the Development-iphoneos
folder.
After changing the configuration name, everything was fine and XCode was happy!
Conclusion
Hope this will fix your issue.
If you have any question about this article, feel free to email me or tweet me @franceleonidev and share your opinion.
Thank you for reading and see you in the next article!
Share this article