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.

Francesco Leoni

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.

No such file or directory fix

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!

No such file or directory fix

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

Related articles


CloudKit With CoreData Not Working in Production

Discover why sometimes the sync between CoreData and CloudKit do not work in production but it does while developing.

1 min read

Q&AErrors

Error “Missing package product“ for Swift Packages (SPM)

See how to fix the “Missing package product“ error in Xcode caused by some Swift Packages added through SPM.

2 min read

Q&AErrors

Fix “Cycle Inside“ Error in Xcode

See how to fix the “Cycle Inside“ error in Xcode. This error happens because there is an issue with the order of scripts.

1 min read

Q&AXcodeErrors