macOS 13 upgraded the xcode git commandline tools always try to find old SDK, even installed git it still claims I need to install - xcode

xcodebuild: error: SDK "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk" cannot be located.
git: error: Failed to determine realpath of '/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk' (errno=No such file or directory)
this caused a dead lock, git can not found this path, and it can not be installed, then it ask to install, I installed, it can not foud this path, and it can not be installed.....
what should I do?

CAUTION: This is not a final fix but a quick one that worked for me.
Hi there,
I tried to delete CommandLine Tools and change the path to Xcode but nothing worked.
When you run xcrun --show-sdk-path it'll look for MacOSX12.3.sdk for some reason, the quickest solution now is to make a link and name it MacOSX12.3.sdk by running the following commands:
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
ln -s ./MacOSX.sdk ./MacOSX12.3.sdk
Cheers!

Running sudo xcode-select --switch /Library/Developer/CommandLineTools at least enabled xcrun --show-sdk-pathto find something instead of throwing an error.
But still it only finds the old MacOSX12.3.sdk

Related

I can not do a "pod install" in CocoaPods

I can not do a "pod install" in any project.
But the thing is that before it could.
What has changed from before to now?
Basically I have installed the new Xcode 10.1 and the new Mojave operating system.
Before I could do all the pod functions and not now. The error that I get is the following:
The Podfile is the following:
EDIT:
If I write:
xcode-select -p
If I write:
xcode-select -s /Applications/Xcode.app/Contents/Developer
Any idea what it can be? Nor did I just see what the error is. Do you see it? I have tried different solutions than those proposed but they do not work ... It's stressful !!
Execute this command in Terminal and try again:
xcode-select -s /Applications/Xcode.app/Contents/Developer
And be sure to update your Cocoapods spec repository by running pod repo update before pod install
Description:
The error is because the wrong path was set as the Xcode Command Line Tools. this can lead to many problems such as git error, C compiler error etc.
Always be sure your Xcode Command Line Tools path has been set to embedded Command Line Tools in Xcode app.

xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist

I'm having xcode issues when I try to use brew and git:
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)
I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:
/Applications/Xcode.app/Contents/Developer
but when I do which xcode-select, it gives me:
/usr/bin/xcode-select
I've tried to use the command switch and install again via Apple Developer site but none of these options have work so far... How can I fix this?
I tried that and it didn't work but I found the answer. I just had to reset the developer's path:
$ sudo xcode-select --reset
Now everything is normal
Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.
To resolve this:
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.
Example (For Xcode 10.0 (10A255) ):
Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 10.0 (10A255).
For more details please see this image:
In my case, I had uninstalled Xcode and then issues with git cli started. I solved the problem running the following commands:
$ sudo xcode-select -r
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
and then validating new path with:
$ sudo xcode-select -p
I have faced the same issue as I have uninstalled the XCode abruptly, running the below command (from Terminal) helped me to resolve this.
sudo xcode-select -switch /
This error coming because xcode get deleted, corrupt or moved.
In my case i removed xcode from my Mac and faced the same issue.
I fixed it by simple two steps
Open Terminal
Simply run following command
sudo xcode-select -r
And now error has resolved. Hope it will helpful.
Use this:
sudo xcode-select -switch /
This should solve the problem.
How about what the error suggests? Did you try that?
xcode-select --switch /Applications/Xcode.app
That should do the trick.
For me it helps to install Xcode CLI
xcode-select --install
after uninstalling XCode (I don't develop for the OSx or iOS)
Then I could successfully build downloaded source with make
Try error suggestion :
sudo xcode-select --switch /Applications/Xcode.app
And Then test Git Executable Path.
I had the same problem and had to remove completely Developer tools, and reinstall:
$ rm -rf /Library/Developer/CommandLineTools
$ xcode-select --install
Tip: because Xcode had been improperly uninstalled, I had to manually (re)move the Xcode app, too:
$ mv /Applications/Xcode.app/ /Applications/Xcode.app.bak
In my case such error occurred after I has tried to symbolicate crash report, and according to a manual, entered command export DEVELOPER_DIR=”/Applications/Xcode.app/Contents/Developer”
I tried some proposed here solutions but nothing helped.
Then I realized that I have added an environment variable DEVELOPER_DIR to my terminal and this led to error: "xcrun: error: missing DEVELOPER_DIR path:"
Then I've just reboot my terminal, that cleaned the environment variable and the error disappeared.
(FYI: environment variables may be checked with printenv command in terminal)
for my mbp m1 apple sillicon for the case alr tried all the above answer and not solved.
i have solved by here discussion https://developer.apple.com/forums/thread/660641
there is have 2 option to solve, my case...
i have uninstalled xcode because i don't need again
install standalone mode, doesnt work. can't install the software
solved by try download manual command line tools check on the discussion thread for the link file ( 741.5 MB ) .

Mac OS X Terminal error: invalid developer directory '/Applications/Xcode-5.1.1.app'

I'm trying to setup and install theos in my Mac OS X El Capitan with terminal. I'm following iPhoneDevWiki (http://iphonedevwiki.net/index.php/Theos/Setup) and doing every single step correctly, I've done it multiple times but everytime I get this little error. I already have all dependencies, the problem comes when I do the following command:
git clone git://git.saurik.com/ldid.git
fatal: destination path 'ldid' already exists and is not an empty directory.
cd ldid
git submodule update --init
./make.sh
Password:
xcode-select: error: invalid developer directory '/Applications/Xcode-5.1.1.app
I have put my password and it did show the error. I have already tried the following commands:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcode-select -s </Applications/Xcode.app/Contents/Developer>
This second one actually leads me to an error of "newline" or something like that.
My xcode version is not 5.1.1, I don't even know why my Terminal is saying Xcode.app is Xcode-5.1.1!
xcode-select -v
xcode-select version 2343.
I have already tried to put the command:
xcode-select -p
The output is:
/Applications/Xcode.app/Contents/Developer
So, if that is the output, why it is saying my developer directory is "/Applications/Xcode-5.1.1.app" ?
Please help me!
Open make.sh file inside ldid folder. In line 16 edit the path to:
/Applications/Xcode.app/Contents/Developer
Then run ./make.sh again.
Change the name of your Xcode app to Xcode-5.1.1 in the Applications folder. That worked for me.

"xcrun: error: active developer path… does not exist, use xcode-select --switch" when trying to run git. How to fix?

I have been trying to instal the Git on my mac, But every time I use the command $git --version.
I get the following error
xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)
I have already installed the Xcode on my mac for iOS App development.
I am not sure what this error is trying to say.
My case:
I removed XCode. JetBrains integration with git - breaks. Found this error in terminal.
My soltuion:
I don't want to download XCode to restore PyCharm. So I ran:
sudo xcode-select --reset
So from discussion in the comments above, it seems the right fix here is just to run the command /usr/bin/xcode-select -switch once (i.e., run it with the full path to the executable, rather than just as xcode-select) with /Applications/Xcode.app/Contents/Developer/ as the argument:
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer
After running that once, everything should work as expected from then on.
sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
and reboot your computer.
Try this below answer. It's worked for me.
Open your Xcode Preferences,
--> Select Locations
--> Select your specific Xcode version in Command Line Tools
It was easier for me to let Xcode pick the install location of Command Line Tools for me, instead of the other way around. After downloading the .xip file from the Apple Developer downloads page, expanding the compressed contents, and installing Xcode.App, I was able to open it using Spotlight.
And open preferences:
And select my Command Line Tools under "Locations".
You can install git via the brew package manager for Mac. I recommend installing software this way since it's a great way to manage your installed packages in one place. For example, you can do brew update to get a list of the latest package updates, or brew upgrade to upgrade all of your software installed through brew.
To install brew, open a terminal window and run:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update your brew packages with brew update
Install git with brew install git
I had installed git, then returned to a terminal window open prior to the installation. I try running command git --version and this raised error message below. To resolve, I ran command source /etc/profile in same terminal window. BTW, terminal window is inside my Webstorm and my end goal is to git init and setup git for my new reactjs project. Happy coding!
The error:
xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use \`xcode-select --switch path/to/Xcode.app\` to specify the Xcode that you wish to use for command line developer tools (or see \`man xcode-select\`)

Unable to get MacPort functionality after installing Xcode 4.3

I am having trouble getting MacPorts to function properly. I just installed OSX Lion 10.7.3 I downloaded and installed MacPorts first, and then after reading the requirements, I downloaded Xcode4.3 from the App Store, and then installed it. I launched Xcode and it looks to be operational and functional. However when I attempted to port with MacPorts, it gave me this error message(excerpt):
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
I followed the advice from:
How do i install additional packages for Xcode on OSX Lion to allow MacPorts to work
and installed command_line_tools_for_xcode from the Preferences within Xcode. I closed Xcode, and again got the errors:
$ sudo port install libsocketsPassword:
Warning: xcodebuild exists but failed to execute
Warning: Xcode does not appear to be installed; most ports will likely fail to build.
---> Computing dependencies for libsockets
---> Dependencies to be installed: openssl zlib
---> Extracting zlib
Error: Couldn't determine your Xcode version (from '/usr/bin/xcodebuild -version').
Error:
Error: If you have not installed Xcode, install it now; see:
Error: http://guide.macports.org/chunked/installing.xcode.html
Error:
Error: Target org.macports.extract returned: unable to find Xcode
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: openssl zlib
Error: Status 1 encountered during processing.
I am uncertain where to go next with this. How do i trouble shoot my Xcode and MacPort interface?
In theory this should work if you have Xcode4.3 installed (in /Applications):
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
(And you've installed the optional command line tools)
Everything will start working fine after installation of "Command Line Tools for Xcode" package.
You can get it from here: https://developer.apple.com/downloads/index.action#
Please see the MacPorts migration instructions for Xcode 4.3.
The instructions are pretty involved. You need to run xcode-select to set a new tools path, update developer_dir in macports.conf (as described by Henk Poley), re-install MacPorts (ouch), and finally uninstall and re-install all of your ports (double ouch).
Edit: libpvx still wouldn't install after the above. Two extra steps were required:
sudo ln -s /Developer /
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs /SDKs
YMMV if you have different ports installed!
Also in /opt/local/etc/macports/macports.conf change the line with developer_dir to point to / instead of /Developer.
After
sudo xcode-select -switch /Applications/Xcode.app
I also had to run
sudo xcodebuild -license
and accept the licence
Here is a solution that has worked for me:
Install Command Line Tools for Xcode
Xcode -> Preferences -> Downloads
Help MacPorts find the right Xcode folder
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
Create symbolic links for clang compilers as they now live elsewhere
sudo ln -s `which clang` /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s `which clang++` /Applications/Xcode.app/Contents/Developer/usr/bin/
Try using trunk, there's no release supporting Xcode 4.3 yet.
Setting the developer path in /opt/local/etc/macports.conf works for me,
developer_dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
since most of the compilers are stored there now instead of /usr/bin under Developer.
None of this works for me. Wait for macports to release a new version that officially supports XCode 4.3+
sudo mv /usr/bin/xcodebuild /usr/bin/xcodebuild.old
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild /usr/bin/xcodebuild
Starting with Xcode 4.3, the command-line build tools are not installed by default. Launch Xcode, open the Preferences, and go to the Downloads tab. From there you should have an option to install the command-line tools.
You can also download them from the web here: https://developer.apple.com/downloads/index.action
Disclaimer: I haven't installed Xcode 4.3 yet. I have only read about it on the web.
As of 27/2/2012, the official suggestion from MacPorts seems to be to not use XCode 4.3 and instead use 4.1 through 4.2.1, which can be downloaded from Apple.
There is a bug ticket which might be useful to follow the evolution of this.
Incidentally, and as reported in my comment #11 in that bug report, I am able to build ports without warnings by using the 2 most sane-looking suggestions found in this question: sudo /usr/bin/xcode-select -switch /Applications/Xcode.app/Contents/Developer and changing developer_dir in /opt/local/etc/macports/macports.conf to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
I have macports installed without admin/root privileges, so I was unable to test the xcode-select answers. However, I observed that Pall Melsted's answer worked, but not initially. What I found out was that I had not accepted the Xcode 4.5 license agreement!
If you have just installed Xcode for the purposes of macports, and you haven't accepted the Xcode license yet, you might get the error presented by the original post. When I checked my Xcode version using /usr/bin/xcodebuild -version, I was given the prompt to read and accept the license. After doing so, and after having made the changes suggested by Pall to the macports.conf developer_dir, it all works now.
As alternative: you can make downgrade of Xcode to 4.2.1 version. DMG of Xcode 4.2.1 placed here: https://developer.apple.com/downloads/index.action
After this MacPorts became works fine for me.
This is fixed in MacPorts 2.0.4.
To upgrade:
Download MacPorts 2.0.4 from the install site or run sudo port selfupdate.
Run the MacPorts migration described here to reinstall all ports. This is painful but required to get back to a working state.
You should definitely run sudo xcode-select -switch /Applications/Xcode.app like everyone here says, that'll fix many problems, but certainly not all.
Afaik, all the remaining problems exist within the configuration information for various packages. You might simply reinstall MacPorts as described in the migration instructions, but I found another solution.
You should begin finding all effected port files using commands like grep /Developer/ ..., after executing sudo bash and cd /opt/local naturally.
You should identify all effected ports by using port provides ..., which I piped through sed and sort | uniq. You could simply reinstall all these ports using either port -n upgrade --force ... or separate port uninstall ... and port install ... commands.
I recommend using one large port -n upgrade --force ... command to avoid duplicate rebuilds of dependencies, using the separate uninstall and install commands afterwards.
There are of course various ports for which /Developer exists only inside text config files, meaning you can fix them manually with sed -i -e 's/\/Developer//g' ..., but you cannot do so with binaries obviously.
I'm afraid you must at minimum rebuild all your Python and Perl installations, making this upgrade an ideal time to clean out packages that depend upon older versions, ala python26 and perl5.8.
There are several technically effected ports I decided against rebuilding like fuse4x-kext, who contained /Developer inside Library/Extensions/fuse4x.kext/Contents/MacOS/fuse4x but hasn't prevented sshfs from working correctly.
I had initially installed xcode 3.2.2, after which I installed 4.3. When I ran the xcode-select, I still got the same error about no xcode project in /Applications. I then dug into the /usr/bin/xcodebuild script and found out that this was working correctly, and another instance of xcodebuild (the one installed with xcode 4.3, not the one in /usr/bin) was being run and returning the error:
xcodebuild: error: The directory /Applications does not contain an Xcode project.
It seems the /usr/bin/xcode-select does not work for xcode 4.3, (it's compiled so you can't really see why it's not working). Strings doesn't give any clues. Good thing osx has strace.. oh wait.
Anyways, the best I could do was modify /opt/local/etc/macports.conf
and uncomment the line containing the path to the xcode installation. That seems to fix my problem for the most part.

Resources