getsentry / sentry-react-native

Official Sentry SDK for React Native
https://sentry.io
MIT License
1.58k stars 337 forks source link

iOS Build Fails Due to Sentry Integration #4100

Closed victorfob closed 1 month ago

victorfob commented 1 month ago

OS:

Platform:

SDK:

SDK version: 5.24.2

react-native version: 0.74.5 Xcode version: 16.0 MacOS version: 15.0 Expoversion: 51.0.31

Are you using Expo?

Are you using sentry.io or on-premise?

Configuration:

Not applicable, the error occurs during the build phase.


I have the following issue:

When attempting to build my Expo managed project for iOS using the command npx expo run:ios, the build process fails. When I try to build the iOS project directly in Xcode, I encounter the following error:

/Users/MY_USER/Development/Projects/project-name/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.c:43:9: 
Missing '#include <sys/_types/_ucontext64.h>'; 'ucontext64_t' must be declared before it is used

Image

After manually including the missing line, the build completes successfully using the same command.

Additionally, if I remove Sentry from the project dependencies, the build proceeds without any issues.

Steps to reproduce:

Actual result:

** BUILD FAILED **

The following build commands failed:
        CompileC /Users/MY_USER/Library/Developer/Xcode/DerivedData/SLUG-CODE/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/Sentry.build/Objects-normal/arm64/SentryCrashMachineContext.o /Users/MY_USER/Development/Projects/project-name/ios/Pods/Sentry/Sources/SentryCrash/Recording/Tools/SentryCrashMachineContext.c normal arm64 c com.apple.compilers.llvm.clang.1_0.compiler (in target 'Sentry' from project 'Pods')
        Building workspace SLUG with scheme SCHEME and configuration Debug
(2 failures)

Expected result:

The iOS build should complete successfully without errors.

kahest commented 1 month ago

Hey @victorfob this is a duplicate of https://github.com/getsentry/sentry-react-native/issues/4097 and a fix is available by upgrading the SDK to 5.31.0 or newer.

victorfob commented 1 month ago

Hey @victorfob this is a duplicate of #4097 and a fix is available by upgrading the SDK to 5.31.0 or newer.

Would it be possible to release a backwards-compatible update, such as version 5.24.3? The reason I ask is that I use Expo, and upgrading to newer SDK versions could potentially introduce other issues since they might not be fully compatible with Expo yet.

Thanks!

@kahest

kahest commented 1 month ago

@victorfob we released 5.24.3 with a bump to sentry-cocoa: https://github.com/getsentry/sentry-react-native/releases/tag/5.24.3

victorfob commented 1 month ago

@kahest Thank you for the quick response and the update! I appreciate the support!