XCode 13.2.1 Executable Not Found - xcode

I am trying to build my react-native ios application on an iPhone 12 (ios 14.3) simulator. After the build succeeds, I am getting an error dialog at the end reading:
"Executable Not Found
/userFolder/Library/Developer/Xcode/DerivedData/eMobility-fzupihuygopdozakomhycmxkpemd/Build/Products/Debug-iphonesimulator/eMobility.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
"
Error details:
"
Executable Not Found
Domain: DVTMachOErrorDomain
Code: 5
Recovery Suggestion: /userFolder/Library/Developer/Xcode/DerivedData/eMobility-fzupihuygopdozakomhycmxkpemd/Build/Products/Debug-iphonesimulator/eMobility.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.
User Info: {
DVTErrorCreationDateKey = "2022-01-12 14:26:52 +0000";
}
I am using the latest XCode version : 13.2.1.
I want to say that the build was working before without changing anything (same simulator). So I am guessing it comes from the latest XCode update

run npm install before run the project from XCode

Related

Build error for simulator with swift package dependency. "Cannot open file handle for file at path: .framework"

I made a simple blank project and added Bugsee via swift-package-manager.
Its located on https://github.com/bugsee/spm.
I can successfully build project for iOS Device.
But it fails for Simulator. And the error is not really verbose
(the path is shortened):
Cannot open file handle for file at path: Path(str: ".../Bugsee.xcframework/ios-arm64_i386_x86_64-simulator/Bugsee.framework")
What does it mean?
The path is valid and the framework is there:
I also found that build for simulator is OK after I have added Bugsee.xcframework into Frameworks, Libraries, and Embedded Content.
Does anyone know what's wrong?
It looks like SPM in Xcode have an issue with i386 arch.
Bugsee released 1.28.0 with dropped support for i386 arch. And now Xcode starts building fine for simulator.
I think i should create a ticket in SPM tracker.

Xcode 11-beta3 build fails when project contains an asset catalog: error: unknown argument '--development-region'

Trying to migrate an existing project to which contains an asset catalog to Xcode11/iOS13. Project builds and runs fine under Xcode 10.3, however when I attempt to compile it under Xcode 11-beta3, it fails with the following message:
: error: Unknown argument '--development-region'
Command CompileAssetCatalog failed with a nonzero exit code
Steps to reproduce:
Create a simple single-view application in Xcode 10.3
Add an asset catalog
Add an image set
Populate the image set
Build and run (project builds and runs fine in Xcode 10.3
Close Xcode 10.3
Reboot Mac (just in case)
Open Xcode 11-beta3
Open the above project
Build (build fails as described above)
Here is a zip file containing the project:
https://1drv.ms/u/s!Aq5tGS9qpM0RrV3zn6_-vAdiDP5u
The project build successfully in Xcode 10.3 but not in Xcode 11-beta3.
I was able to resolve the issue by removing and re-installing xCode 11

GeneratedInfoPlistDotEnv.h file is not found

I have a issue, regarding Xcode, in react-native permission file
in which GeneratedInfoPlistDotEnv.h file is not found.
How to fix this?
Already changed Info.plist Preprocessor Prefix File to
${CONFIGURATION_BUILD_DIR}/GeneratedInfoPlistDotEnv.h
but it did not solve.
issue is:
:1:10: fatal error:
'/Users/DAMAGE/Library/Developer/Xcode/DerivedData/EmployWise-fzbhiywasjfdjnfqjsfnxjbhahzs/Build/Products/GeneratedInfoPlistDotEnv.h'
file not found
Was getting this from react-native-config cocoapod. But its been fixed in v1.4.11. Was due to the older version not writing output script variables, which XCode 14 requires
This issue comes when react native is not able to link to the configuration file like .env file created in your react native environment. If you have used any react native config framework like react-native-config. then make sure this framework is linked for your iOS environment as shown below
react-native link react-native-config
If you are using react-native version >= 0.60 then follow the below steps after linking is done.
Go to ios folder and run pod install.
Next do the following:
1. Remove Derived Data from Xcode
2. Clean Build Folder
3. Build the project again
I had this problem, my solution was to change the Xcode build system from "Legacy Build System" to "New Build System" in the Workspace Settings under the File menu
In my case, I was trying to add a new target for rn-extensions-share and forgot to add all necessary libraries for that new target.

Can't find React native project on iOS Simulator or Xcode project

I have deleted my project on Xcode may it be .xcworkspace or .xcodeproj.
Because of that, I had to delete IOS and android folders while downgrading, updating and re-upgrading my react version to re-install IOS and android folders.
Thanks to that the emulator is working but unfortunately the project isn't present in the emulator and is still absent with Xcode. One thing to point out is that the simulator only appears when ran in the integrated terminal and nor in general terminal after cd-ing in the project folder.
Can anyone please help re-integrating the project in the emulator and on Xcode, please.
Here is the error when the emulator is running in a general terminal:
Here is the error when the emulator is running in a general terminal:
error Command failed: xcrun instruments -s
xcrun: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.1.sdk' (errno=No such file or directory)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
Here is the error for building the project within emulator when ran from VS code integrated terminal:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening project.xcodeproj
The process you need to follow is so similar to renaming a react native app. Basically you just need to run react-native upgrade in your root project directory. For further info you can check another question here. The instructions below explains how to create another react native project based on a copied one with a new name.
First copy the directory which your to-be-name-changed application exists. And go to your newly cloned directory.
Change the name at index.ios/android.js file which is given as a parameter to AppRegistry.
Change the name and version accordingly on package.json
Delete /ios and /android folders which are remaining from your older app.
Run $react-native upgrade to generate /ios and /android folders again.
Run $react-native link for any native dependency.
Finally run $react-native run-ios or anything you want.
Courtesy of
https://stackoverflow.com/questions/42506068/how-can-i-regenerate-ios-folder-in-react-native-project

Build error when trying to compile Chess.app

I have downloaded Chess.app from opensource.apple.com. When I run xcodebuild install I get an error:
fatal error: 'CoreFoundation/CFLogUtilities.h' file not found
#import <CoreFoundation/CFLogUtilities.h>
^ 1 error generated.
The same error occurs when Building within XCode.
I have looked in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/Headers/ and, sure enough, CFLogUtilities.h is not present. I see that it's available to download from Apple's Open Source Website, but I feel like if it's linked in an app bundled with the OS, it should be installed by default, or at least after installing XCode + Command Line Tools.
Do I have to manually download and bundle the header file in order to build the project, or am I missing something?
I don't know what OS version you are using, but to compile this on 10.9 simply change CFLogUtilities.h to CoreFoundation.h.
you also either need to build the CrashReporterClient.a library and add it to the project, or remove it from the "link with libraries" build setting for the target.
a shell script will fail because iconcompiler is missing, but you can comment out that script line with a # and run just fine. I will leave it as an exercise to you to figure out how best to restore the app icon.

Resources