[Solved] iOS Broken dependency: @sentry/react-native 5.27.0

Software:

  • Mattermost Mobile Release 2.20.1
  • Ruby 3.2.2 (Installation of Ruby 3.0.6 failed over and over - it’s an unsupported and end-of-life version)
  • macOS Sequoia 15.0.1
  • Xcode 16.0

Hardware:

  • Mac mini, M1 2020

So first of all npm install works perfectly fine without any errors.
But then everytime I try to build the mobile release 2.20.1 with the npm-dependency @sentry/react-native 5.27.0, I get a Xcode error

Missing ‘#include <sys/_types/_ucontext64.h>’; ‘ucontext64_t’ must be declared before it is used

While researching, I found out, that this is a bug in sentry and it was fixed with v5.31.0.
See missing ucontext64_t type Xcode Version 16.0 (16A242d) · Issue #4097 · getsentry/sentry-react-native · GitHub

But Mattermost is using Sentry v5.27.0.
So how is it possible for you to build that with a broken dependency?

Best regards
Jens

Hi Jens, thanks for bringing this up! It sounds like the issue may stem from the older version of Sentry being used in the Mattermost mobile build. You could try updating the Sentry dependency to v5.31.0 in your local environment as a temporary fix while we investigate. Let us know if you need further assistance!

Hi John,

thanks for your answer and sorry for my late response. I already tried that:

  • changed @sentry/react-native to v5.31.0
  • removed node_modules, package-lock.json, ios/Podfile.lock, ios/Pods
  • cleared all cached (at least all caches I know)

But after that you still get many errors:

  • this error in like 100 lines: Gekidou/Sources/Gekidou/Storage/Database+Category.swift:7:44 Missing argument label 'value:' in call
  • and some others…

In the meantime I switched some software and hardware parameters (but that didn’t help):

  • macOS Sequoia 15.1
  • Xcode 16.1
  • MacBook Pro M4

What is the supported MacOS / Xcode version for building Mattermost v2.22.0?
I think I have to downgrade MacOS…

~ Jens

Hi Jens, thank you for the detailed follow-up and for pointing out the root cause related to Sentry!

@matthewbirtch - Is this something that we would be able to create a Jira ticket for so the team can review upgrading Sentry in future releases to address compatibility with Xcode 16.0?

In the meantime Jens, feel free to share any other insights or challenges you encounter! Let us know how else we can assist. :blush:

@jherman if you are trying to build 2.20.1 that is an old version by now that is using an old version of Sentry and also has some issues building on xcode 16

So you have three options here

  1. Build your target version with Xcode 15
  2. Make the changes to your target version so that it can build on Xcode 16, changes for this can be found in the repo Add fixes for xCode 16 changes (#8254) · mattermost/mattermost-mobile@94a7231 · GitHub
    1. Build a newer version of the app

Hope this helps

1 Like

Thank you so much @elias !
I thought v2.22.0 is the newest version, because that is the latest tag (used in Github) and the latest release, but there already is a newer release branch v2.23.0 with the Xcode 16 fix. Now it’s working totally fine! Thanks again :slight_smile:

1 Like