title: xcrun invalid active developer path error in macOS
body: <p>I have recently updated my Mac to Catalina, but have been knitting Rmd documents just fine up to this point.</p>
  <p>In a current document, I am getting the following error when I try to knit:</p>
  <p><strong>xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun</strong></p>
  <p>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:</p>
  <pre><code>xcode-select --install
  xcode-select --reset
  </code></pre>
  <p>Both of these lines of code just gave me an <em>object not found</em> error.</p>
  <p>I ran these with no luck:</p>
  <pre><code>xcode-select --switch /Applications/Xcode.app
  xcode-select --switch /Library/Developer/CommandLineTools
  </code></pre>
  <p>I then realized these commands should go in the terminal, but still have no luck.</p>
  <p>I went to <a href="https://developer.apple.com/download/more/" rel="nofollow noreferrer">https://developer.apple.com/download/more/</a> and downloaded Command line tools OS Xcode 12.3dmg package.</p>
  <p>I then tried all of the above code in the <em>terminal</em>, including:</p>
  <pre><code>sudo xcodebuild -license accept
  </code></pre>
  <p>Now, instead of giving me the error message that I started with, the knit just loads indefinitely.</p>
  <p>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!</p>