'Executable Not Found. xxx.app is not a valid path to an executable file

Details

Executable Not Found Domain: DVTMachOErrorDomain Code: 5 Recovery Suggestion: /Users/riber/Library/Developer/Xcode/DerivedData/digitalCurrency-hiyiyrokjaydkiagjimlwohehrtu/Build/Products/Debug-iphonesimulator/digitalCurrency.app 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.

System Information

macOS Version 11.4 (Build 20F71) Xcode 12.5 (18205) (Build 12E262) Timestamp: 2021-06-11T16:34:20+08:00



Solution 1:[1]

Check if all files are available.

Targets -> Build Phases -> Compile Sources

If you see faint files, then they need to be removed or added.

View Screen

Solution 2:[2]

Under "Build Settings" - "Architectures" check that you don't have "arm64" excluded under "Excluded architectures" for release, as all new iOS devices use this architecture.

Solution 3:[3]

I'm also get the same error. Let me share how I fix it.

.app is not a valid path


I write cpp code on vscode.
I deleted a .cpp/.h file that I didn't need anymore a few days ago.
Everything nice and happy when I working on vscode.


".app is not a valid path" appeared when i switched back to the xcode to verification function.
I was confused.
(I don't immediately remember my delete operation a few days ago)


The key isn't the dialog showed "Executable Not Found",
Switch to "Issue Navigator" and drag to the bottom...
Now the ERROR shows up in front of U:

enter image description here


Finally the solution is :

TARGETS -> Select your ‘Target' -> Build Phases -> Compile Sources :

Select the ".cpp" file that had been delete, then "Remove Items" by click the second "-" button in the lower left corner.

Solution 4:[4]

Check the Executable File in the Info(.plist). It should be named the same as your Product in Products

Solution 5:[5]

I fixed it by adding x86_64 to VALID_ARCHS. Build Setting search "VALID_ARCHS",check the x86_64 is there or not, add and run.It worked with me .

Solution 6:[6]

I have this issue on a react native application and I can resolve it reinstalling cocoaPods.

pod install

Inside the ios folder on your react native project.

Solution 7:[7]

resolve it using pod install. as Frank said, I also use RN in my app.

I have tried clean derived data & even reboot, still happening

Solution 8:[8]

Check if you have any other info.plist-s added to project. I had similar issue when I added some pod sources (MKStoreKit) to the project - it had several info plists for different platforms which interfered with original one. Deleting wrong info plists solved the issue.

Solution 9:[9]

I have to delete the 'DerivedData' folder:

$ rm -Rf ~/Library/Developer/Xcode/DerivedData

Solution 10:[10]

EDIT: I've found a solution...

The problem in my case was because of project configurations and Pods. In the long life of my project the configuration files for the schemes changed and Xcode, using the new build system, did not like.

To fix it, just go to the Project -> Info tab. Under Configurations change the Based on Configuration value of the Targets and set them to None. Please note that I've changed only the Targets. Now close Xcode and launch pod install from the Terminal. reopen Xcode and launch your project.

enter image description here


Old answer:

I may have found 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.

Solution 11:[11]

In my case, my AppDele.swift file and Runner-Bridging-Header.h file were deleted, so I copy and paste both the files in ios>Runner folder again from some other project (usually both of these files are same in all projects).

Solution 12:[12]

if you are using git, there's huge chance there might be conflict in .pbxproj due to multiple people adding stuffs together. During the resolution xcode might try to recover those 'lost references' it got confused and unable to resolve the once there references. find those 'recovered references' in project explorer and remove them if they are invalid

Solution 13:[13]

Had the same issue. I deleted the simulators and added them again.