Symbol not found: _OBJC_IVAR_$_NSScroller._action in High Sierra
Asked Answered
B

5

21

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.

Bunnybunow answered 28/2, 2018 at 22:22 Comment(1)
Were you able to find a solution for this?Midgard
M
36

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.

Middleton answered 30/4, 2020 at 18:53 Comment(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...Inelastic
@Inelastic 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.Middleton
B
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.

Bemis answered 5/11, 2018 at 15:57 Comment(2)
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.Waxman
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.Rhombic
G
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/
Graeco answered 23/10, 2018 at 10:55 Comment(3)
This did nothing for me, kept getting a different error. Installing x-code seemed to fix the issue for me.Bemis
Thank you merciful person... Just ended my 1 hour of suffering.Olia
If you upgraded from 2 (or more) versions ago, e.g. Sierra (10.12) -> Mojave (10.14), then you might need both @Bemis 's suggestion above and then this one. See my comment above against prolink007's answer.Waxman
O
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/
Ovation answered 17/5, 2020 at 10:53 Comment(0)
D
0

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

Decontrol answered 12/8, 2021 at 11:59 Comment(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.Minton
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.Decontrol

© 2022 - 2024 — McMap. All rights reserved.