iOS Use of undeclared identifier
OS:
- [ ] Windows
- [x] MacOS
- [ ] Linux
Platform:
- [x] iOS
- [ ] Android
SDK:
- [x]
@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
- [x] No
Are you using sentry.io or on-premise?
- [x] 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
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 |
For me, the problem happens after removing yarn.lock file and run yarn install again.
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.
Same issue
Same issue!
Is there any solution tried other version also, but same error 😔
Same issue. Do you have any update on this, please?
"react-native": "0.72.0",
"@sentry/react-native": "^5.23.0",
Pls update version follow here,it will be fixed:
"@sentry/react-native": "5.20.0"
@lozyloop12 Earlier, I tried with 5.20.0 and I had the caret symbol there. Thank you, mate.
Same issue
same issue :"
Same issue
@EricNetsch Try with "@sentry/react-native": "5.20.0". It worked for me.
Thanks,
I backdated to "@sentry/react-native": "5.20.0" and it looks like its working again for me
yarn install
pod update
Same issue updating "@sentry/react-native": "5.20.0". is not worked pod install showing RNSentry version 5.23.0
@Binishatk try to delete Podfile.lock file then run pod install
@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
"@sentry/react-native": "5.22.3", worked for me.
Pls update version follow here,it will be fixed:
"@sentry/react-native": "5.20.0"
It worked 😊
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".