react-native 0.059 on xcode 13 build error on ios - xcode

I have an existing project but I got a new macbook with m1.
When running ios I got an error.
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find instruments 2> /dev/null' failed with exit code 17664: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
error Command failed: xcrun instruments -s
xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find instruments 2> /dev/null' failed with exit code 17664: (null) (errno=Invalid argument)
xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
I found that instrument was deprecated on xcode 13.
Is there any work around for this one?
Thank you

Related

xcode-select cannot locate clang, even after installing command line tools

When I try to run the clang command, I get the following error:
xcode-select: Failed to locate 'clang', requesting installation of command line developer tools.
And then I receive this pop-up:
However, no matter how many times I click "Install" - going through a 15-minute install process - I continue to get the same error.
I have also tried running xcode-select --install however that gives the following error:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
I have also tried manually installing from here.
I'm on an M1 mac running macOS Monterey Version 12.5.
It also yields a core dump:
2022-09-19 10:51:04.669 xcodebuild[1541:17443] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle “IDESimulatorAvailability” couldn’t be loaded.}, dyldError = dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0000): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'
2022-09-19 10:51:04.688 xcodebuild[1541:17443] [MT] DVTAssertions: ASSERTION FAILURE in /System/Volumes/Data/SWE/Apps/DT/BuildRoots/BuildRoot2/ActiveBuildRoot/Library/Caches/com.apple.xbs/Sources/DVTFrameworks/DVTFrameworks-21303/DVTFoundation/PlugInArchitecture/DataModel/DVTPlugIn.m:374
Details: Failed to load code for plug-in com.apple.dt.IDESimulatorAvailability (/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin)
Please ensure Xcode packages are up-to-date — try running 'xcodebuild -runFirstLaunch'.
NSBundle error: Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator'" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, NSDebugDescription=dlopen(/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability, 0x0109): Symbol not found: (_OBJC_CLASS_$_SimDiskImage)
Referenced from: '/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin/Contents/MacOS/IDESimulatorAvailability'
Expected in: '/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/CoreSimulator', NSBundlePath=/Applications/Xcode.app/Contents/PlugIns/IDESimulatorAvailability.ideplugin, NSLocalizedDescription=The bundle “IDESimulatorAvailability” couldn’t be loaded.}
Object: <DVTPlugIn: 0x60000080b7a0>
Method: -loadAssertingOnError:error:
Thread: <_NSMainThread: 0x600002c402c0>{number = 1, name = main}
Hints:
Backtrace:
0 0x000000010653d410
1 0x000000010653caec
2 0x000000010653cc6c
3 0x00000001063eb2ac
4 0x00000001063b1118
5 0x00000001063af528
6 0x0000000181aa01b4
7 0x0000000181aaf414
8 0x000000010658158c
9 0x000000010655d4b0
10 0x00000001063af3c0
11 0x00000001063af5e0
12 0x00000001074372ec
13 0x0000000107436ae0
14 0x00000001074361e8
15 0x0000000104c70324
16 0x0000000104c21e0c
sh: line 1: 1543 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null
clang: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find clang 2> /dev/null' failed with exit code 34304: (null) (errno=Invalid argument)
How can I install clang?
Please ensure Xcode packages are up-to-date — try running xcodebuild -runFirstLaunch.
This worked for me.
I had the same problem and updated Xcode, relinked paths etc, which didn't help.
What worked was opening Xcode after the update and accepting the prompt to load essential development tools (for macOS and iOS).
A bit hidden in the error message is also the CLI solution: "Please ensure Xcode packages are up-to-date — try running 'xcodebuild -runFirstLaunch'."
You can also open Xcode, select the default runtime tools (MacOS and iOS in my case), then clang should run as normal.
I believe this is the same as doing #LanderTome's answer, but not able to verify.
After installing XCode 14.1 on MacOS Ventura 13.0.1, my clang didn't work with an error very similar to this, and repeatedly tried to install the XCode command line tools. It turns out that xcode-select was pointing to the command line tools that are part of the full XCode package, and failing to find clang in there. clang is included in the command line tools package, but not in some versions of the full XCode package.
What I did to fix it was:
sudo xcode-select -switch /Library/Developer/CommandLineTools
This switches the location that clang and other tools are run from. If you want to switch back to running them from the XCode package, you can use:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

golang can't start debug, shows framework not found CoreFoundation

I'm using Macbook pro m1, after data migration or update to monterey(not sure which cause this), golang seems can't debug or go list -compiled. I tried to reinstall/update golang and the result is same
go version: 1.17.3 darwin/arm64
Error msg when I start debug
Build Error: go build -o /var/folders/x8/s3w_s9rj0qj74hs68wvqs1740000gp/T/__debug_bin4251008076 -gcflags all=-N -l .
# runtime/cgo
ld: framework not found CoreFoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation) (exit status 2)
Error msg when go list -compiled
# runtime/cgo
ld: framework not found CoreFoundation
clang: error: linker command failed with exit code 1 (use -v to see invocation)
confcenter
what can i do, any idea?
You need to reinstall the CommandLineTools. xcode-select says everything is up to date, but this information seems to be false.
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

xcrun --show-sdk-version error, can't build with xcode on mojave

I'm having problems getting a cmake project to compile with xcode on macOS Mojave. Here's the error message associated with the build problem.
-- [polly] Used toolchain: Xcode (OS X default) / clang / LLVM Standard C++ Library (libc++) / c++11 support
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" cannot be located.
xcrun: error: unable to lookup item 'SDKVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'
'xcrun --show-sdk-version' failed
Additionally, I've stumbled on the following incoherence.
localhost:~ ram$ xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
localhost:~ ram$ xcrun --show-sdk-version
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk" cannot be located.
xcrun: error: unable to lookup item 'SDKVersion' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'
I've also noticed that xrun is able to find 'MacOSX10.13.sdk', but not in the same path:
localhost:~ ram$ xcrun --sdk macosx10.13 --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk
Does anyone know what might be the problem and, more importantly, how to fix this?

MacOsX Sierra (Cocoa pod) : sh: line 1: 4169 Bus error: 10 /usr/bin/xcrun clang 2>&1

When I type pod init, i got this message:
sh: line 1: 4169 Bus error: 10 /usr/bin/xcrun clang 2>&1
I have also this error message when I type : brew doctor (sh: line 1: 4389 Bus error: 10 /usr/bin/xcrun clang 2>&1)
And when I type :pod repo update --verbose i got the same :
sh: line 1: 4405 Bus error: 10 /usr/bin/xcrun clang 2>&1
I think it comes from clang, because when I just type clang i got :
Bus error: 10
Anyone has a idea of what it is wrong ?
Thanks !
PS: I tried to remove all /Users/User_Name/Library/Developer/Xcode/DerivedData/. folders and it does nothing to solve my problem

Apple Mach-O error. Every app has this 2 same errors

All my apps are not compiling anymore, and then 2 Apple Mach-O errors appear.
this is what Xcode shows:
clang: error: unable to execute command: posix_spawn failed: Exec format error
clang: error: linker command failed due to signal (use -v to see invocation)
To solve it, just download the packs that are on:
Xcode -> Preferences -> Downloads

Resources