xcode 13 executable file not found
Asked Answered
T

14

12

I've an error with xcode 13. When i try to run my app on a real device (arm64 architecture) i got the following error:

Executable Not Found

Domain: DVTMachOErrorDomain

Code: 5

Recovery Suggestion: /path/to/file/MyApp.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 setting to ensure that a valida executable will be built.

has anyone ever had this problem? The build process finish without errors. Right now i've excluded x86_64 architecture from "Excluded Architectures" option and set the parameter "Architectures" to "Standard Architectures (arm64, armv7)".

Testimony answered 28/6, 2021 at 16:27 Comment(0)
B
8

TARGET -> Build Settings, search 'VALID'.

Set VALID_ARCHS, add x86_64 if run with a simulator, else set arm64.

Brocket answered 27/8, 2021 at 1:4 Comment(4)
Can't find the VALID_ARCHS settings...Shechem
I am using M1 mac, and set Build Active Architecture to NO fixed my problemPhotosphere
@Shechem It's in TARGET instead of PROJECTUndulatory
there is no option on VALID_ARCHS .Digged
W
6

I faced the same problem and resolved it by deleting files and folders below,

Pods , Podfile.lock and mme.xcworkspace

And running pod install

Werth answered 19/2, 2022 at 11:31 Comment(0)
H
6

This Error occur because there was a missing file.

Click on the Error icon on the top header and you redirect to errors there you notice there are some files that are not there or missing.

Added the file and run your project again working correctly.

Hoofed answered 8/4, 2022 at 11:8 Comment(0)
A
1

I got the same error and it was just because I didn't change the build settings correctly after I renamed the folder where Info.plist belongs to.

So I needed to change this setting so that it was the same with the actual path of Info.plist: enter image description here

Arriviste answered 28/12, 2021 at 8:31 Comment(0)
D
1

Did you make sure that the executable file MyApp located in your folder /path/to/file/MyApp.app/ matches the value of the Executable file attribute in your Info project file?

On my machine, the executable path is : /Users/.../DerivedData/Debug-iphonesimulator/Runner.app/Runner. I noticed that the executable name (Runner in my case) was wrong in the Info file. Correcting it fixed the issue for me.

See the the screenshot below :

enter image description here

Divergency answered 28/12, 2021 at 16:50 Comment(0)
R
1

Check if there are any deleted files(which happens when you pull the code from Git) and add those files back, Close Xcode, Restart the system, Clean the Project and Run the Project this Worked for me.

Rebel answered 3/1, 2022 at 7:37 Comment(0)
P
1

I had this error as well. This is not a blanked solution fix.

For me Xcode had some broken references to files, so I had to connect them and set the file location to be "relative to group" vs "relative to project"

The error was being incorrectly reported as "Executable not found" when building the error was more clear.

Build input file cannot be found: '/Users/MY_USER_NAME/Programs/ios/PROJECT_DIR/SRC/file.xib' is not found.

Polynesia answered 24/1, 2022 at 18:14 Comment(1)
I finally find out that coworker has put missing files on git, and I ignored the error message saying "xxx file is missing" and only focus on the alert window! this error message is wrong and misleading!Photosphere
E
1

Some file is missing, you just have to add from project folder. Just restart your Mac and open XCode with your project, you will see the missing file. I have previously tried every possible solution like cleaning derived data, running pod install but nothing worked. Try above solution

Eras answered 16/9, 2022 at 15:1 Comment(0)
H
0

Perhaps the executable file entry is wrong in your Info.plist?

The entry Executable file should be set to $(EXECUTABLE_NAME).

Honesty answered 1/8, 2021 at 19:5 Comment(0)
U
0

Targets -> Build Settings, search plist

Set Generate Info.plist File to No, set Info.plist File with your info.plist file path.

That's works for me.

Ultrafilter answered 27/10, 2021 at 7:47 Comment(0)
C
0

I encountered this issue just now after setting up a new prefix header to my product target with a wrong file path:

$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.h

Correct it to

$(SRCROOT)/$(PROJECT_NAME)/PrefixHeader.pch

resolved my issue. What a stupid Xcode!

Careaga answered 6/6, 2022 at 14:21 Comment(0)
K
0

pod install or pod install --repo-update should work !

Kildare answered 22/7, 2022 at 14:45 Comment(0)
R
0

For me, I removed the files in Recovered Reference folder. Then this error gone.

Reduce answered 4/8, 2022 at 11:52 Comment(0)
E
0

Fast forward to 2022, I got this error after having installed a TestFlight version and was trying to run from Xcode. I deleted the app off my phone, ran again, and was able to install successfully. I hope this helps someone!

Espousal answered 5/10, 2022 at 17:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.