xcode 13 executable file not found - ios

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)".

TARGET -> Build Settings, search 'VALID'.
Set VALID_ARCHS, add if run with a simulator, else set arm64.

I faced the same problem and resolved it by deleting files and folders below,
Pods ,
Podfile.lock and
mme.xcworkspace
And running pod install

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.

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:

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 :

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.

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.

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

Perhaps the executable file entry is wrong in your Info.plist?
The entry Executable file should be set to $(EXECUTABLE_NAME).

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.

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!

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

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

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!

Related

Xcode13.2.1 M1 build executable not found

I ran into the infamous "executable not found" error when building on the new M1 mac machine (Monterey) on Xcode 13.2.1. I should note I am building an extension (not sure if that makes a difference), the build would be successful and the error seems to happen during installation.
I have tried the solutions from general google search and most are mentioned on this other stackoverflow post(non M1), such as:
Set "Build Active Architecture Only" to No
Check if my "Executable Name" is set to $(EXECUTABLE_NAME)
Check if my "Info.plist" path is corrert under the Deployment section of Build Setting
Ran "pod install"
Check if I have any missing file (? this one I am not super sure how but I don't see any "fainted" files when following this other Stackoverflow post's top answser)
Anyone else running into this on M1? what is your solution?
It's an issue with the excutable address inside the info.plist file. Pls double check your info.plist files both on the ShareExtension and your target.

missing required module 'SwiftShims' error generated by Xcode in project

I copied my project in a running state but the copied project doesn't work for me although the actual project is running fine. When I build my copied project it gives me the following error:
I have cleared the cache and the derived data but the build still fails.
Does anyone have an idea what might cause this issue? Thanks in advance.
If you are using CocoaPods, open yourProject.workspace instead of yourProject.xcodeproj.
If you're working with SPM, deleting the .build folder and re-running swift build solves the issue for me.
Did you try to remove the cache ?
rm -rf /Users/abdulrehman/Desktop/StudentMentor/DerivedData/ModuleCache/DLJPQMLQI1Q/
(I might have wrong copied your file path. So feel free to type it manually if there is nothing to remove at this path)
Goto your project folder
Delete the contents inside the DerivedDataXcode folder.
Clean the project
Run.
I had the same error, but the reason turned out to be having different iOS versions specified as Podfile's platform :ios and as my project's deployment target.
SwiftShims is a module defined in the standard library. It shouldn't be missing. I think it's because your DerivedData path changed, and now the compiler can't find its cache anymore.
I had the same issue...and after a lot of trial and error, the following worked for me..
Open your Xcode Workspace File -> Project_name(directory option on left) -> build settings -> Excluded Architectures -> Select 'Any iOS simulator SDK' and type arm64 in front of that ( for both build and release).
Repeat the same procedure for pods
Go to VS code and delete pod-lock and pod folder
open podfile and Paste the following code right above "target 'name-tvOS' do" in podfile.
post_install do |installer| flipper_post_install(installer) installer.pods_project.build_configurations.each do |config| config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64" end end end
(Note: some of the code body form above may already be there. In that case replace that part with this.)
Save it and run 'pod install' in your project's terminal.
go back to xcode and clear build (Cmd+Shift+K) and then build your project (Cmd+B)
Hopefully it will build without any issues.. Happy Coding!
You may get this error if you rename the project directory.
For your reference, I was using Flutter, so
flutter clean
It was solved with.
I have once encountered for a private local pod, which somehow Cocoapod set the lib product name as eg. "MyLib-6c4b1003" -- with a prefix in hex.
This random hex somehow changed, but the project Other Link Flags still using the old one. I did the search to find out the references to the old hex and deleted them, run pod install and the right name will be used.
I still cannot understand why there is this random hex in the prefix, but seems like Cocoapods setting up of the project could reference to the wrong one.
I had a similar issue when I wanted to remove Alamofire from Cocoapods.
then it needs to delete something:
target -- Build Settings -- Other Swift Flags
This junk of code worked for me.
It happened to me when I was running the release version and switched back to the Debug version with Product > Scheme > edit schemes.
Deleting derived data didn't help.
But simply doing Product > Clean Build Folder and restarting XCode fixed the issue.
In case you see this error in the preview canvas and the diagnostics "mtime changed":
'/var/folders/kv/t_w2wdds3m1_0lr02hcp3dgw0000gn/C/clang/ModuleCache/12TRQXIDQ8QQD/SwiftShims-2TTN5UXQBRCCQ.pcm' was built: mtime changed
Delete all .pcm files in that folder and hit try again.
The folder on your machine will be different. Copy the location and run:
rm <paste path here>/*.pcm
You can delete your Derived Data from Terminal by this simple command:
rm -rf ~/Library/Developer/Xcode/DerivedData/*

iOS Swift No Such File or Directory In Debug-iphoneos

Somebody please save me.
This is the error I'm getting. I've tried cleaning, doing a build clean, pod installs and updates. I have not found a solution.
Shell Script Invocation Error Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/Anti-Social: No such file or directory
I have similar issues in the past and doing the following work for me. Hope your problem is same as mine:
Close xCode
Go to this folder Group
/Users/arthuraraujo/Library/Developer/Xcode/DerivedData/Anti-Social_Club-gizjofrkxroutxezxlbuadlvpwbo/Build/Products/Debug-iphoneos/
and delete Anti-Social.
Restart xCode, clean & build.
It is hard to really tell you the solution with just the information provided. However, the first thing I would try is deleting the derived data, as CodeBender stated. You should also look at your search paths in your project's building settings to make sure your pods are correct/ connecting your pods files to your project.
Possible duplicate of:
Xcode 8 Shell Script Invocation Error
Here is what I did when I got this:
Used this site to completely remove All Versions of cocoapods:
https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
Re-installed current stable version of cocoapods (v1.1.1 for me)
Deleted podlock and pods directory
Deleted old .xcworkspace file (this was key for me).
Did "pod install"
Opened xcode and cleaned project and deleted derivedData.
Go to your build phases and remove libReact.a from the linked libraries.
Then add libReact.a but select this one:
libReact.a from 'React' target in 'Pods' project

Xcode dependency anaylsis error

On my Xcode project, I tried to compile. But I couldn't do that because of some errors
Those are like as follows.
Unable to run command 'CpResource XXX.app' - this target might include its own product.
Unable to run command 'Touch XXX.app' - this target might include its own product.
So I tried to clean project, but I couldn't do that also.
How can I fix these errors?
Hope your help. Thanks.
In Xcode, go to your Products folder and make sure your .app file has no Target Memberships in the file inspector. Nothing should be checked. I had the same issue and that fixed it for me.

Getting <comand line> error - info.plist file not found

I was using Xcode and tried running the project and suddenly got this error. The info.plist file in build settings is linked to the proper directory. I've tried quitting Xcode and re-starting my computer - no luck. I have no idea what to do. Can't find anything online. Any ideas? Thanks
Go to your project file in Xcode, ensure that your path is the path of the info.plist file... Also, make sure the name of the files are the same ../thepathtoyouinfoplist/info.plist and info.plist

Resources