Executable Not Found ,Xcode

Executable Not Found

Domain: DVTMachOErrorDomain

Code: 5

Recovery Suggestion: *** is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.

User Info: {

    DVTErrorCreationDateKey = "2021-12-29 04:46:38 +0000";

}

I don’t know what’s going on. Suddenly, my project can’t run. The above information is displayed. I have reinstalled Xcode and reinstalled the mac system, but it still doesn’t work. Can someone help me?

Hi, have you tried clearing your derived data folder and doing a clean build of the project? Sometimes that resolves unexpected errors like this one.

Deleting the derived data and cleaning the build doesn't help in this case

Ah, that’s unfortunate that clearing build artifacts didn’t resolve the issue. Which Xcode version are you using? This could also be a bug in Xcode, so it might be worth filing a bug report on Feedback assistant.

Wow this just started happening to me too! It was literally working 12 hours ago :(

Edit: was just a coincidence. This is what happened to me and how I fixed it. My code was using a SwiftGen auto-generated Swift file containing enums. Because I changed the output filename last night and deleted the originals on the command line but not the actual Xcode IDE (which means Xcode didn't realize this change), whatever Xcode generates will be corrupt. Ideally, Xcode would encounter a build failure. Because it didn't, then the failure would have to turn up when loading it onto the simulator. This explains why the error made no sense, since Xcode kept saying that the path was erroneous when in fact the path DID exist.

Once I deleted the references to the non-existent files and added the new files, Xcode then expectedly complained that the old enum didn't exist. After I made those updates and ran the build, it worked.

"deleted the references to the non-existent files and added the new files" Thank you very much, it worked for me.

"deleted the references to the non-existent files and added the new files" Thank you very much, it worked for me too.

Yup, this worked for me too. I created and deleted a file in a subproject but Xcode still had a reference to it. The offending file was highlighted in red. Deleting it fixed the issue. Xcode 13.2.1

This started happening to us and we haven't been able to resolve it. We don't use Swift.

We tried rolling down to an older Xcode but that didn't help.

We fixed this first problem by:

  1. remove vallid_archs from build
  2. add Any iOS Simulator SDK with value arm64 inside Excluded Architecture.

And now we get this: Executable Not Found Domain: DVTMachOErrorDomain

Code: 5 Recovery Suggestion: *** is not a valid path to an executable file. Please rebuild the project to ensure that all required executables are created. Check your project settings to ensure that a valid executable will be built.

Any guidance will be greatly appreciated. Because we need to test the app on the simulator.

I may have find a workaround to this issue... not a solution but a workaround. I have to work on a not really recent project that was built using the Legacy System that, as you may know, is deprecated now. While I was using Xcode 12 everything was fine. Then I installed the Xcode 13 GM and I upgrated the project to the new building system and I started to experience this issue. I have the same problem with any Xcode 13.x version. With the betas I had not, as far as I can remember. The strange thing is that "sometimes" (I could not reproduce it sorry), the new build system worked... but just for a while. The building phase succeeds but then, then the app is installed on simulator OR on a real device, I have that annoying message that we know... This morning I may have find a solution... In Xcode go to File -> Workspace Settings, keep the Legacy Build System and check the box "Do not show a diagnostic issue about build system deprecation" Now the app builds and can be installed. Honestly I don't know it is an Xcode bug or not... maybe it is.

Just Happened to me. Removing broken references did solve the problem

I am still facing this issue and I am not sure which non-existent files you guys are talking about, so that I can remove the references. Stuck with this. Can someone help me?

Already tried:

  • Clearing derived data folder
  • Deleting the project and cloning a fresh copy for github
  • pod deintegrate and pod install

Nothing worked.

Executable Not Found ,Xcode
 
 
Q