getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
806 stars 317 forks source link

Compiler Error with Xcode 16 Beta 6 #4299

Closed dehlen closed 1 month ago

dehlen commented 2 months ago

Platform

iOS

Environment

Other

Installed

CocoaPods

Version

8.34.0

Xcode Version

16.0 Beta 6

Did it work on previous versions?

No issues in Xcode Version 15.4 (15F31d)

Steps to Reproduce

  1. Compile App with sentry-cocoa
  2. Build Issues in Sentry target in the Pods project

Expected Result

No compiler errors

Actual Result

Build throws multiple errors:

Image

Are you willing to submit a PR?

No response

brustolin commented 2 months ago

Hello @dehlen, thanks for reaching out. I was unable to reproduce this. Do you know if your project has any specific setup?

Could you try to reproduce this in a new project?

dehlen commented 2 months ago

Nothing too fancy I am aware of. We have a bridging header which includes this line:

#import <Sentry/Sentry.h>

Also the build issues do not occur with Xcode 15.4 only using Xcode 16.

dehlen commented 2 months ago

Oh and also we are using Sentry via react-native-sentry here are the important lines from Podfile which states we are using 8.34.0:

- RNSentry (5.30.0):
    - hermes-engine
    - React-Core
    - React-hermes
    - Sentry/HybridSDK (= 8.34.0)
brustolin commented 2 months ago

@krystofwoldrich, can you give this a try on a RN sample?

dehlen commented 2 months ago

I just did.

  1. Created a new project via npx @react-native-community/cli init
  2. Added sentry dependency to the package.json
  3. Ran yarn, bundle install, bundle exec pod install
  4. Opened xcworkspace with Xcode 16 Beta 6 I am receiving the same build errors with this template project.
dehlen commented 1 month ago

Do you think it makes sense to forward this to the react-native-sentry repository? As it is a problem with Xcode and the error seems to be happening compiling the Sentry framework for me I thought it would be best to open this issue here. However if you think it might be related to the react-native-sentry SDK I can duplicate this issue in the other repo.

dehlen commented 1 month ago

I removed derived data, did another sentry update and rebuild my project and now it seems to be working 🤷‍♂️ Sorry for the time you invested in this. I could reproduce the issue. Not sure what ultimately fixed it but it seems Xcode just had some invalid caches causing it to build unsuccessfully.

brustolin commented 1 month ago

Thanks for the update @dehlen!!