19

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.

1
  • Were you able to find a solution for this?
    – iamwhoiam
    Oct 11, 2018 at 3:34

5 Answers 5

34

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.

2
  • 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 2, 2020 at 23:01
  • 2
    @Figulus You're not alone - Xcode can be confusing. Per Apple dev docs, "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, 2020 at 6: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.

2
  • 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, 2019 at 0: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, 2019 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/
3
  • 2
    This did nothing for me, kept getting a different error. Installing x-code seemed to fix the issue for me.
    – prolink007
    Nov 5, 2018 at 15:57
  • Thank you merciful person... Just ended my 1 hour of suffering. Dec 18, 2018 at 7: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, 2019 at 0: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/
0

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

2
  • 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, 2021 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, 2021 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.