16

I get the below error message when I run git for the first time after a reboot:

objc[728]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x1eff3a7a0) and ?? (0x1188402b8). One of the two will be used. Which one is undefined.
objc[728]: Class AMSupportURLSession is implemented in both ?? (0x1eff3a7f0) and ?? (0x118840308). One of the two will be used. Which one is undefined.

It doesn't happen with other commands like go. Any idea what it means?

This is on a new M1 MBA.

bmike
  • 226,393
  • 78
  • 398
  • 871
frank cedar
  • 161
  • 1
  • 1
  • 4
  • 1
    How well do you know objective c? I’d like to tailor my answer to your level if possible. If you were to try and fix `git`, here is a reference. If you just want to use `git`, it’s easier to explain. https://stackoverflow.com/questions/8886321/class-x-is-implemented-in-both-y-and-z-one-of-the-two-will-be-used – bmike Nov 29 '20 at 17:43
  • https://github.com/flutter/flutter/issues/72492#issuecomment-800117908 – Pablo Mar 16 '21 at 10:01

3 Answers3

7

I got the same warning after having to reinstall Xcode (for a different reason - it's not a requirement). Running sudo xcode-select -s /Applications/Xcode.app fixed the issue.

David
  • 170
  • 1
  • 4
  • I didn't need to reinstall Xcode but I did run the command it worked! – software is fun Jan 07 '22 at 17:36
  • 3
    rather than `-s` which will "set the path for the active developer directory", another option is `-r` to "reset to the default command line tools path" — `sudo xcode-select -r` – shawncampbell Jan 31 '22 at 16:12
6

I encountered the same problem. I installed Xcode, and installed "git" on "brew", I uninstalled "git" on "brew" and it solved the problem for now, no more errors.

O.Stacool
  • 61
  • 2
4

It means two symbols are defined twice in the git program that’s first in your path (or that you call by a full path).

You can ignore that message 99.9% of the time. It’s there for the devlopers to clean up since there are two definitions of the same function / library.

This is only a problem if all of the below are satisfied:

  1. The functions are actually different and not just duplicated
  2. Your usage of the functions breaks due to the difference
  3. You lose the lottery and call the version you don’t want to run this time

It’s not a good thing to have, but alone isn’t a problem. If you work with the code, you would want to inspect both - and fix the duplication since it’s an edge case that could cause pain / crash / issues down the road.

bmike
  • 226,393
  • 78
  • 398
  • 871
  • 1
    I have Xcode installed but I don't do anything with it (I work primarily with Go). Any idea why `git` triggers the message? – frank cedar Nov 29 '20 at 17:09
  • What is the precise path to the git you call? The idea is that binary links against two libraries for a function it calls @frankcedar – bmike Nov 29 '20 at 17:40
  • I first noticed it when I ran my command alias `gs` which maps to `git status`, where `git` is `/usr/bin/git` – frank cedar Nov 29 '20 at 17:59
  • 1
    So Apple shipped that bug, when you update, it may be fixed at some point. Or you could install your own binary and patch it and run out of usr local – bmike Nov 29 '20 at 18:32