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.

What are you thoughts about this? Tweet me @franceleonidev and share your opinion.

Source link