Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to compile on latest xcode 16 + 8.32 #4233

Closed
MattJustMatt opened this issue Aug 5, 2024 · 15 comments
Closed

Failing to compile on latest xcode 16 + 8.32 #4233

MattJustMatt opened this issue Aug 5, 2024 · 15 comments

Comments

@MattJustMatt
Copy link

Platform

iOS, iPadOS

Environment

Develop

Installed

CocoaPods

Version

8.32.0

Xcode Version

16b

Did it work on previous versions?

yes, 8.19

Steps to Reproduce

Update to xcode beta, update to 8.32.0

Expected Result

Compiles without breaking changes

Actual Result

We had to update Sentry-Cocoa to address a compilation failure in xCode 16.

Now we have two more errors:
SentryId *tid = [[SentryId alloc] initWithUUIDString:ns_trace_id];

Receiver 'SentryId' for class message is a forward declaration

SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelWarning];

Use of undeclared identifier 'kSentryLevelWarning'

Are you willing to submit a PR?

Not familiar enough to say

@brustolin
Copy link
Contributor

Hello @MattJustMatt, thanks for reaching out.
I could not reproduce this problem. Do you have anything different in your cocoapod setup?

Can you share the error log? I would like to see which files contain these errors.

@barisyild
Copy link

I have the same problem, but I don't use cocoapod :(

@brustolin
Copy link
Contributor

@MattJustMatt, @barisyild, are you using Sentry in an Objc project?
Is the error in your own code when you're trying to use Sentry API`s?

We had reports of this error when users are importing sentry from the umbrella header instead of importing the module.

Instead of #import <Sentry/Sentry.h>
Use @import Sentry;

@kahest
Copy link
Member

kahest commented Aug 7, 2024

related docs PR: getsentry/sentry-docs#10994

@barisyild
Copy link

@MattJustMatt, @barisyild, are you using Sentry in an Objc project? Is the error in your own code when you're trying to use Sentry API`s?

We had reports of this error when users are importing sentry from the umbrella header instead of importing the module.

Instead of #import <Sentry/Sentry.h> Use @import Sentry;

Yeah i am using objc project and importing sentry swift fixes my issue.

@MattJustMatt
Copy link
Author

Image

Ty! I made this adjustment, and updated to beta2, hitting this issue now. I'm sorry if this is noisy just made the mistake updating to Sequioa and locked into the new Xcode betas.

If this is on Apple's end totally understand if we don't want to be supporting beta releases...

@harish-suthar
Copy link

harish-suthar commented Aug 8, 2024

@MattJustMatt I am facing a simmilar issue on Xcode 16 beta 5?

Image

@brustolin
Copy link
Contributor

@MattJustMatt, @harish-suthar. This was fixed already, we're releasing a new version today.

@brustolin
Copy link
Contributor

brustolin commented Aug 8, 2024

We need to investigate whether it is possible to keep using only #import <Sentry/Sentry.h>.

@MattJustMatt
Copy link
Author

We need to investigate whether it is possible to keep using only #import <Sentry/Sentry.h>.

This would be helpful. We have a cross platform app that loads the headers in a .cpp/.mm file and there may be some noise trying to get modules to work in this context, haven't investigated deeply yet

@MattJustMatt
Copy link
Author

Turns out switching to modules is non trivial in our codebase (enabling the compiler flag for them causes all sorts of downstream issues).

A header file import route would be very appreciated if it's possible!

@MattJustMatt
Copy link
Author

Image

Good news! We managed to get past some of the include issues by adding the module compile flag to just our platform_interop.mm that includes Sentry. This is working on iOS but we're hitting a different error on M1 Macs/Arm64

@kahest
Copy link
Member

kahest commented Aug 9, 2024

Thanks for keeping us updated - we'll definitely look into providing a header import, but we don't have an ETA at the moment

@brustolin
Copy link
Contributor

Hello @MattJustMatt
I believe you can use the following workaround:

#import <MetricKit/MetricKit.h>
#import <Sentry/Sentry.h>
#import <Sentry/Sentry-Swift.h>

Until we find an alternative solution.

@kahest
Copy link
Member

kahest commented Aug 14, 2024

We received feedback that the above workaround functions as intended - so we're closing this. If you're impacted by this and the above doesn't work, please let us know

@kahest kahest closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

No branches or pull requests

5 participants