'xcrun invalid active developer path error in macOS

I have recently updated my Mac to Catalina, but have been knitting Rmd documents just fine up to this point.

In a current document, I am getting the following error when I try to knit:

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

I don't know why this particular markdown document is creating an issue when the others weren't. I have looked elsewhere on Stack, where I tried the following:

xcode-select --install
xcode-select --reset

Both of these lines of code just gave me an object not found error.

I ran these with no luck:

xcode-select --switch /Applications/Xcode.app
xcode-select --switch /Library/Developer/CommandLineTools

I then realized these commands should go in the terminal, but still have no luck.

I went to https://developer.apple.com/download/more/ and downloaded Command line tools OS Xcode 12.3dmg package.

I then tried all of the above code in the terminal, including:

sudo xcodebuild -license accept

Now, instead of giving me the error message that I started with, the knit just loads indefinitely.

At this point, I'm just throwing crap at the wall, without knowing what it is that I'm actually doing. Any guidance from this point is greatly appreciated. Thank you!



Solution 1:[1]

May be the issue was view() instead of View().

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Luca De Benedictis