20

An application which worked on previous versions of MacOS fails on High Sierra with the following message:

dyld: Symbol not found: _OBJC_IVAR_$_NSScroller._action Referenced from: Expected in: /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit

What change might lead to this issue? (I am not expert in MacOS development) I suspect otool command might help identify changes related to this problem but haven't worked out the right parameters for it yet.

Checking AppKit documentation https://developer.apple.com/documentation/appkit/deprecated_symbols it says NSDrawer is deprecated, is this related?

NSDrawer [deprecated] A user interface element that contains and displays text, scroll, and browser views, in addition to other view subclasses.

Malcolm McCaffery
  • 2,468
  • 1
  • 22
  • 43

5 Answers5

35

Same issue for Catalina upgrade.

Verified the old directory...

$ xcode-select -p

> /Applications/Xcode.app/Contents/Developer

But when running the switch directory command, it failed:

$ xcode-select -switch /Library/Developer/CommandLineTools

> xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/'

Solution

Had to do the following:

  1. Install xcode-select (which will notify xcode cli dev tools needs to be downloaded & installed)

    $ xcode-select --install
    

    > xcode-select: note: install requested for command line developer tools

  2. Now, run the switch command & everything should be well again in the world.

    $ sudo xcode-select -switch /Library/Developer/CommandLineTools/
    
  3. Profit

Hope this helps.

cjn
  • 1,331
  • 1
  • 16
  • 22
  • I tried *sudo xcode-select --install*, but I got an incredibly helpful pop-up: *Can't install the software*. So I tried *sudo xcode-select -switch /Library/Developer/CommandLineTools/* and tried again, but got no luck. Will try updating Xcode, although my AppStore says it doesn't need updating... – Figulus Aug 02 '20 at 23:01
  • 2
    @Figulus You're not alone - Xcode can be confusing. Per [Apple dev docs](https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-WHAT_IS_THE_COMMAND_LINE_TOOLS_PACKAGE_), "The Command Line Tools Package is a small self-contained package available for download separately from Xcode and that allows you to do command line development in macOS." So your Xcode Command Line Tools package could need updating (`$ xcode-select --install`) while your Xcode IDE in AppStore may not. – cjn Aug 12 '20 at 06:23
18

I had to download Xcode (update Xcode) to resolve this issue.

Running this command sudo xcode-select -switch /Library/Developer/CommandLineTools/ did not seem to work for me. But try doing it too.

Iulian Onofrei
  • 9,188
  • 10
  • 67
  • 113
prolink007
  • 33,872
  • 24
  • 117
  • 185
  • 10
    I had to do **both** this suggestion **and** @approximatehack 's suggestion below. I think it's because I upgraded from 2 versions ago, i.e. Sierra (10.12) -> High Sierra (10.13) -> Mojave (10.14). To be explicit, I first needed to run `xcode-select --install` to (re)install the Xcode Command Line Tools, and after that run `sudo xcode-select -switch /Library/Developer/CommandLineTools/` to update the path where the CLTs are located. – stwr667 Jan 18 '19 at 00:11
  • 1
    I went from 10.12 to 10.14 and then 10.14.5 and the first part worked for me. `xcode-select --install`. I ran into this doing `brew update`. – ekrich Jun 19 '19 at 15:55
15

I was getting this error because of the active developer directory was unset after MacOS version upgrade. This directory controls which tools are used for the Xcode command line tools (for example, xcodebuild) as well as the BSD development commands (such as cc and make).

Doing the following fixed the issue for me:

sudo xcode-select -switch /Library/Developer/CommandLineTools/
Kalamarico
  • 5,466
  • 22
  • 53
  • 70
approximatehack
  • 171
  • 2
  • 7
  • 2
    This did nothing for me, kept getting a different error. Installing x-code seemed to fix the issue for me. – prolink007 Nov 05 '18 at 15:57
  • Thank you merciful person... Just ended my 1 hour of suffering. – Evren Ozturk Dec 18 '18 at 07:05
  • If you upgraded from 2 (or more) versions ago, e.g. Sierra (10.12) -> Mojave (10.14), then you might need both @prolink007 's suggestion above and then this one. See my comment above against prolink007's answer. – stwr667 Jan 18 '19 at 00:14
0

Faced the exact same issue today when I upgraded to macOS Catalina from high sierra.

What worked for me is,

1) Install Command line tools

xcode-select --install

2) Update the active developer directory path

sudo xcode-select --switch /Library/Developer/CommandLineTools/
Bivil M Jacob
  • 471
  • 4
  • 9
0

What worked for me was: sh-3.2# /usr/bin/xcode-select -switch /Library/Developer/CommandLineTools/.

QB1979
  • 123
  • 1
  • 8
  • You don't need the `/usr/bin/` part unless your Xcode Tools installation had failed to finish properly. The PATH should have been set. // And without that part, this solution has already been posted. – Eric Aya Aug 12 '21 at 12:01
  • This happened to me on corporate laptop, when I upgraded to new system version. I think this may be some edge. I hope it will be useful for someone ending up on this thread. – QB1979 Aug 12 '21 at 15:40