VS Code C Error - Invalid Active Developer Path
Asked Answered
W

3

7

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

This is the error I get in VS Code's terminal. There are error squiggles under the "#include <stdio.h>" line.

This is after I upgraded to Mac OS Monterey.

What is the reason for this error and what is the solution?

Waggoner answered 1/11, 2021 at 10:30 Comment(2)
You probably need to (re?)install XCode command-line tools. This might help: freecodecamp.org/news/install-xcode-command-line-toolsSimulcast
You can try this solution https://mcmap.net/q/647836/-xcrun-error-invalid-active-developer-path-problem-after-zsh-update-for-flutter .Scissor
T
10

When upgrading your Mac OS, sometimes the code command-line tools stop working. This can be resolved by running this in the terminal:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

If you don't have Xcode installed you should do:

xcode-select --install

which will install the command-line tools without having Xcode.

Treacy answered 24/11, 2021 at 7:17 Comment(0)
K
4

The fix, luckily, is pretty straight forward. Install the Xcode toolkit! Even if you had it installed before, you might have to re-register it or update it to the latest version.

$ xcode-select --install

If that doesn’t work, force it to reset. You’ll need sudo access for this one.

$ sudo xcode-select --reset
Kirby answered 1/11, 2022 at 6:56 Comment(1)
Thank you! sudo xcode-select --reset did the trick for me.Cachepot
I
1

trying to learn python :

I cant install python on my mac ,some error when installing , tried donwloding all version for mac , still same error :https://www.python.org/downloads/macos/

when debuggong in VS Code : manually-specify-an-interpreter

https://code.visualstudio.com/docs/python/environments#_manually-specify-an-interpreter

tried to install an interpreter , failed

checked installed version on my mac , only found a path in xcrun: error: invalid active developer path, problem after zsh update for flutter

this worked out

xcode-select --install

This helps me fixing

Interpret answered 28/1, 2023 at 17:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.