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

iOS Use of undeclared identifier #3863

Closed
5 of 11 tasks
ajouve opened this issue Jun 5, 2024 · 30 comments
Closed
5 of 11 tasks

iOS Use of undeclared identifier #3863

ajouve opened this issue Jun 5, 2024 · 30 comments

Comments

@ajouve
Copy link

ajouve commented Jun 5, 2024

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 5.23.0

react-native version: 0.73.7

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

I have the following issue:

When I am trying to run or archive on xcode I have the following errors

- node_modules/@sentry/react-native/ios/RNSentry.mm:565:27 Use of undeclared identifier 'kSentryLevelFatal'
- node_modules/@sentry/react-native/ios/RNSentry.mm:567:27 Use of undeclared identifier 'kSentryLevelWarning'
- node_modules/@sentry/react-native/ios/RNSentry.mm:569:27 Use of undeclared identifier 'kSentryLevelError'
- node_modules/@sentry/react-native/ios/RNSentry.mm:571:27 Use of undeclared identifier 'kSentryLevelDebug'
- node_modules/@sentry/react-native/ios/RNSentry.mm:573:27 Use of undeclared identifier 'kSentryLevelInfo'; did you mean 'sentryLevel'?

I tried to remove node_modules, package-lock.json, ios/Pods, ios/Podfile.lock, then reinstall, install pods and clear cache on xcode and I still have the same issue

I also tried with module version 5.22.0, 5.22.1, 5.22.2 and 5.22.3 and I have the same issue

Steps to reproduce:

  • Step 1: npx @sentry/wizard -s -i reactNative
  • Step 2: install pods
  • Step 3: Build or archive

Actual result:

Errors

Expected result:

Should build

@mpanac
Copy link

mpanac commented Jun 5, 2024

Same issue when building my project after updating rn sentry to the latest version >>:

› Compiling @sentry/react-native Pods/RNSentry » RNSentry.mm

❌ (node_modules/@sentry/react-native/ios/RNSentry.mm:565:27)

563 | SentryLevel sentryLevel;
564 | if ([levelString isEqualToString:@"fatal"]) {

565 | sentryLevel = kSentryLevelFatal;
| ^ use of undeclared identifier 'kSentryLevelFatal'
566 | } else if ([levelString isEqualToString:@"warning"]) {
567 | sentryLevel = kSentryLevelWarning;
568 | } else if ([levelString isEqualToString:@"error"]) {

❌ (node_modules/@sentry/react-native/ios/RNSentry.mm:567:27)

565 | sentryLevel = kSentryLevelFatal;
566 | } else if ([levelString isEqualToString:@"warning"]) {

567 | sentryLevel = kSentryLevelWarning;
| ^ use of undeclared identifier 'kSentryLevelWarning'
568 | } else if ([levelString isEqualToString:@"error"]) {
569 | sentryLevel = kSentryLevelError;
570 | } else if ([levelString isEqualToString:@"debug"]) {

❌ (node_modules/@sentry/react-native/ios/RNSentry.mm:569:27)

567 | sentryLevel = kSentryLevelWarning;
568 | } else if ([levelString isEqualToString:@"error"]) {

569 | sentryLevel = kSentryLevelError;
| ^ use of undeclared identifier 'kSentryLevelError'
570 | } else if ([levelString isEqualToString:@"debug"]) {
571 | sentryLevel = kSentryLevelDebug;
572 | } else {

❌ (node_modules/@sentry/react-native/ios/RNSentry.mm:571:27)

569 | sentryLevel = kSentryLevelError;
570 | } else if ([levelString isEqualToString:@"debug"]) {

571 | sentryLevel = kSentryLevelDebug;
| ^ use of undeclared identifier 'kSentryLevelDebug'
572 | } else {
573 | sentryLevel = kSentryLevelInfo;
574 | }

❌ (node_modules/@sentry/react-native/ios/RNSentry.mm:573:27)

571 | sentryLevel = kSentryLevelDebug;
572 | } else {

573 | sentryLevel = kSentryLevelInfo;
| ^ use of undeclared identifier 'kSentryLevelInfo'; did you mean 'sentryLevel'?
574 | }
575 | [breadcrumbInstance setLevel:sentryLevel];
576 |

@w1ll-dev
Copy link

w1ll-dev commented Jun 5, 2024

For me, the problem happens after removing yarn.lock file and run yarn install again.

@charlesfsl
Copy link

This is happening for me after merging two branches, one of which had Sentry in it. I have made sure the Sentry pod was updated, wiped out node_modules and re-ran yarn install, re-ran the Sentry NPM install wizard, but the issue persists. It looks like there have been no changes to those identifiers in ios/RNSentry.mm since at least 5.19.0.

@ashadnasim52
Copy link

Same issue

@manfredxu99
Copy link

Same issue!

@ashadnasim52
Copy link

Is there any solution tried other version also, but same error 😔

@LuckyMadu
Copy link

Same issue. Do you have any update on this, please?

"react-native": "0.72.0",
"@sentry/react-native": "^5.23.0",

@lozyloop12
Copy link

Pls update version follow here,it will be fixed:
"@sentry/react-native": "5.20.0"

@LuckyMadu
Copy link

@lozyloop12 Earlier, I tried with 5.20.0 and I had the caret symbol there. Thank you, mate.

@EricNetsch
Copy link

Same issue

@astikatika
Copy link

same issue :"

@rodrigodiasf1984
Copy link

Same issue
image

@LuckyMadu
Copy link

@EricNetsch Try with "@sentry/react-native": "5.20.0". It worked for me.

@EricNetsch
Copy link

Thanks,
I backdated to "@sentry/react-native": "5.20.0" and it looks like its working again for me

yarn install
pod update

@Binishatk
Copy link

Same issue
updating "@sentry/react-native": "5.20.0". is not worked
pod install showing RNSentry version 5.23.0

@astikatika
Copy link

@Binishatk try to delete Podfile.lock file then run pod install

@rodrigodiasf1984
Copy link

@Binishatk try to delete Podfile.lock file then run pod install

it doesn't wokr, i've removed the Pods, build and Podfile.lock

run pod install --repo-update and the error persist

@camilossantos2809
Copy link

"@sentry/react-native": "5.22.3", worked for me.

@ashadnasim52
Copy link

Pls update version follow here,it will be fixed: "@sentry/react-native": "5.20.0"

It worked 😊

@charlesfsl
Copy link

Confirmed that it's now working for me with 5.22.3. At the start of this, when this issue first started for me, I was on 5.22.2. I tried updating to 5.23.0 as a first step to try and fix it. Looks like the OP had this issue on "5.22.0, 5.22.1, 5.22.2 and 5.22.3".

@dpyeates
Copy link

dpyeates commented Jun 6, 2024

Just updated to 5.23.0 and I am now getting these errors.

Have done a fresh yarn install and pod install --repo-update

@slauzinho
Copy link

Having the same issue using 5.23.0:
CleanShot 2024-06-06 at 16 53 08@2x

Removed the node_modules, Pods and Podfile.lock

did pod install --repo-update

@uzegonemad
Copy link

At first glance, it looks like this may be the culprit: getsentry/sentry-cocoa#3963

@w1ll-dev
Copy link

w1ll-dev commented Jun 6, 2024

5.20.0 worked for me after clean yarn cache.

1 - delete yarn.lock
2 - delete podfile.lock
3 - yarn cache clean
4 - yarn
5 - pod install

@lazaro-contato
Copy link

updates?

@attarchi
Copy link

attarchi commented Jun 6, 2024

@sentry/react-native@5.22.3 is okay

@Binishatk
Copy link

@Binishatk try to delete Podfile.lock file then run pod install

Already tried, does not work

@Binishatk
Copy link

"@sentry/react-native": "5.22.3",

Work for me

@krystofwoldrich krystofwoldrich self-assigned this Jun 7, 2024
@krystofwoldrich
Copy link
Member

Hello everyone,
this bug was introduced in https://github.com/getsentry/sentry-react-native/releases/tag/5.23.0.

Please use https://github.com/getsentry/sentry-react-native/releases/tag/5.22.3 on iOS until the fix is released.

The bug was fixed in #3854 and will be released shortly.

@krystofwoldrich
Copy link
Member

https://github.com/getsentry/sentry-react-native/releases/tag/5.23.1 was released

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