Xcode13.2.1 M1 build executable not found - ios

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.

Related

xcode 13 executable file not found

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!

Error: Build Input file not found, when tried to run the app on iOS simulator

After upgrading the Xcode to 12.2 from 11.x , I'm getting a wierd error when trying to run the app on iOS Simulator.
The error is:
error: Build input file cannot be found: '/Users/mrt/Library/Developer/Xcode/DerivedData/xxx-fqqnstjlfcnipqbcjbnhysubdksn/Build/Products/Debug-iphonesimulator/xxx.app/xxx' (in target 'xxx' from project 'xxx')
Here the missing /xxx is the unix executable file inside the .app folder.
When I try to build it on phone, there is no such error.
When I checked the location in finder, the unix executable file inside the .app is missing, for Debug-iphonesimulator, but it is present in Debug-iphoneos
I have no idea, why that executable file is missing.
I have added the arm64 in the excluded arch section in the new Xcode. Both in project and target Buil Settings.
I tried changing project settings to Legacy Build, and it resulted in same error.
I haven't moved any plist files or any files in my project. I deleted some unused targets and related files. The error didnot mention anything about deleted files. Hence I do not think , those could be the reason. I tried this SO link, and it didnt solve my issue. My plist file path is $(SRCROOT)/xxx/SupportingFiles/xxx.plist
I did delete derived data and clean, many times. Not solved.
I tried adding x86_64 under VALID_ARCHS and adding arm64 under exluded arch settings, as suggested in here. Not solved.
Is there anything that I'm missing ?
THIS error maybe your update Xcode version like: Xcode 10 to Xcode 12, the your old PROJECTS will got this error, can't running your app again.
Try this:
1:
VALID_ARCHS (in the "Architectures" tab) key on the BuildSettings of "PROJECT" GROUP
or just search "VALID_ARCHS", maybe in the other Tabs( or in the "User-Defined")
set value "arm64" or others
IMG SIMPLE:
2:
select TARGETS: your app's target
search for the same KEY ("VALID_ARCHS") and just selection the current row and click "delete" on your keyboard, there will be with default values(it is the same value of PROJECT's Build Settings )
3: clear and rebuild

React Native xcode project "Header Search Path"

Following the steps from React Native official tutorial, the xcode project created by "react-native init MyFirstRNProject" won't compile. It complains "React/xxxxx.h" can't be found.
After further investigation of this xcode project, I figured the "React" target contains a build phase "Copy Headers" which copies all exposed headers into a weird location:
"MyFirstRNProject/node_modules/react-native/React/build/Debug-iphonesimulator/include/React"
OK, cool, at least we got the header location. We can change the copied location to somewhere else that better than this. So whichever the project that do "#import < React/xxxxx.h >" should have above path in "Header Search Path" in build settings. Unfortunately, all projects have "Header Search Path" empty. And that's why I'm getting tons of header not found error.
OK, let's add it. Now it finds headers, but compilation still failed, see reference below:
https://github.com/facebook/react-native/issues/21482
The discussion above saying that removing the "Header Search Path" of the projects will solve the problem. But we know that without header search path, it again can't find React headers.
Just curious now, I don't think my setup is wrong, does anyone has the same issue?
I had the same problem on fresh install of Xcode 10.1
There are few steps to follow to compile the new project after react-native init appName
In Xcode, Select File -> Project/Workspace Settings. You will see a Build System option to select the Legacy Build System as shown below
Change Advanced settings, and set Build Location to Custom and change paths to Relative to Workspace and Build/ to build/Build/ as showed.
3. User Debug for command-line builds(for react-native run-ios to work properly)
Clear your project
After this manipulations(don't need set header search paths) you'll be able to build and run empty project via Xcode or CLI

TwitterKit does not compile with Xcode 6.3

I added TwitterKit from Fabric to an app under Xcode 6.3.
The app would compile before I added TwitterKit's Run Script build phase step but once I added TwitterKit it failed with this error during Debug builds:
2015-02-23 11:22:32.382 run[53735:1513077] Fabric.framework/run 1.3.13
2015-02-23 11:22:32.388 run[53735:1513077]
Fabric: dSYM Error
Unable to process fabrictest.app.dSYM at path /Users/mfoouser/Library/Developer/Xcode/DerivedData/fabrictest/Build/Products/Debug-iphonesimulator/fabrictest.app.dSYM
Make sure your project build settings are generating a dSYM file. DEBUG_INFORMATION_FORMAT should be set to dwarf-with-dsym for all configurations. This could also be a timing issue, make sure the Fabric run script build phase is the last build phase and no other scripts have moved the dSYM from the location Xcode generated it.
Command /bin/sh failed with exit code 1
Anyone find a way around this?
This was a simple fix. Just do as the error state, turn on dSYM generation for your debug build.
Change your Build Settings from this:
To this:
Then choose Build again. It should now compile and run.
You can follow below steps ,it worked for me.
open build setting of your project and search for "Generate debug symbol" and set it to Yes.
As in the below screenshot
Search for debug information format in build setting and search for "Debug information format" then set "Debug information format" to "DWARF with dSYM file"
This didn't work for me since it was already set to 'with dSYM' and it didn't build as well. After more digging and trying things out, it seems like the issue (for me at least) is under Build Settings > Generate Debug Symbols, which was set to No by default. I changed it to Yes and it worked like a charm.
No one of proposed answers worked out for me.
Deleted both Fabric.framework and Crashlytics.framework which were added via Fabric app and added them again through Cocoapods.
**It doesnt mean that Cocoapods is only workaround, but probably that they should be re-added to project again.
What worked for me was the previous answers combined:
1- Change "Build Settings -> Debug Information Format -> Debug" value to "DWARF with dSYM File"
2- Change "Build Settings -> Generate Debug Symbols" value to "Yes"
3- Remove Fabric and Crashlytics frameworks and install again

scons invocation error building AllJoyn for iOS

I'm trying to build AllJoyn for IOS using Xcode (5.1.1) on OSX Mavericks (10.9.3). I have followed all the steps posted here to the letter but keep getting a "Shell script invocation error", error: can't exec 'scons' (No such file or directory) on the last step in the instructions and cannot figure out how to resolve it, I have installed scons with homebrew and tried donloading and installing it manually but for some reason it can't find it. Any help would be much appreciated.
I found a solution. Brady's comment was right, Xcode could not find scons.
In order to fix it, I changed the field for "Build Tool" under Target -> info, it originally had only "scons" as its value so I did a search for it in a terminal (which scons), and put the full path in the setting (in my case "/usr/local/bin/scons").
In addition to this issue, I had an issue with openssl not being found even after executing the command launchctl setenv OPENSSL_ROOT <path to top level folder of openssl> so under Build Settings I added a user-defined setting with the key "OPENSSL_ROOT" with the value of the full path to the openssl top level folder.

Resources