Failed assertion on startup in macOS 12 Monterrey

On Monterrey, the major macOS version has been bumped to “12”, and I get a failed assertion on startup in :

SystemStats::OperatingSystemType SystemStats::getOperatingSystemType()
   #if JUCE_IOS
    return iOS;
    StringArray parts;
    parts.addTokens (getOSXVersion(), ".", StringRef());

    const auto major = parts[0].getIntValue();
    const auto minor = parts[1].getIntValue();

    if (major == 10)
        jassert (minor > 2);
        return (OperatingSystemType) (minor + MacOSX_10_7 - 7);

    jassert (major == 11);    // <-- ASSERT FAILS HERE
    return MacOS_11;

Apple will probably keep bumping major versions: next year there will be a macOS 13, etc. Dear JUCE team, could you please future-proof this code accordingly? Thank you :heart:

It looks like you are using a fairly old version of JUCE. Monterey support has been added to that method since a70488e3 and the enum will be updated with new macOS versions.

Thanks @ed95 ! That’s odd, I did a git pull yesterday. Must have done something wrong. Apologies for the noise.

1 Like