linking error file cannot be open()ed, errno=2

I have been learning from the Apple Developer tutorials and I got stuck on the ScoreKeeper chapter with Testing. Since my Macbook Pro 2017 can only use Xcode 15.2 as the highest level, I am having issues with it. I saw a forum post that a certain level of Swift and the tool chain would fix this. I attempted to install Swift 5.10.1 to then realize I only had Xcode 15.2 not 15.3, so I had to attempt to install Swift 5.9. Since neither option worked, I uninstalled Xcode and removed any extra files along with swift packages, minus my projects, to redownload and reinstall Xcode 15.2. Now I am having issues with building the scheme, and I get link error,s and they pertain to Swift 5.10.1, which I had not installed any Swift packages after the Xcode reinstallation. I have tried another previous project even a new one same error. This was 7/30/25, as of today 7/31 I tried to install Swift 5.9 thinking it would overwrite or "downgrade" the package, no such luck. The file path in the error stops at the /.../...RELEASE.pkg file and does not continue, which seems to be the issue of the error. How to I fix this issue, I had a working product 3 dyas ago

Answered by asje2005 in 851600022

I found a solution to the build scheme. Xcode>Toolchains>"select Default or whatever Xcode version you have" Xcode15.2. Then Clean Build Folder, and content view is back. As for Testing, still nothing.

Accepted Answer

I found a solution to the build scheme. Xcode>Toolchains>"select Default or whatever Xcode version you have" Xcode15.2. Then Clean Build Folder, and content view is back. As for Testing, still nothing.

If you’re just getting started then I definitely recommend that you stick with the toolchain built in to Xcode. While it’s certainly possible to get Xcode to use later toolchains, it takes you well off the beaten path, and thus makes it more likely you’ll encounter weird problems.

As to your remaining issue:

As for Testing, still nothing.

it’s hard to offer advice without knowing more about your setup. Specifically:

  • What version of macOS is this?
  • What version of Xcode did you settle on?
  • What is the exact problem?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

linking error file cannot be open()ed, errno=2
 
 
Q