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

App Crash in React Native - [__NSDictionaryM setObject:forKey:]: key cannot be nil #3681

Open
3 tasks done
himujs opened this issue Feb 22, 2024 · 9 comments
Open
3 tasks done

Comments

@himujs
Copy link

himujs commented Feb 22, 2024

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/react

SDK Version

7.102.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

As soon as I open my React Native app it gives an error -

Error Details
the issue in finding the setObject:forKey: in Container+SentryDeepSearch.m (path - pods/sentry/sources/SentryCrash/Reporting. It might be due to the updates in the dependency of the sentry.

Expected Result

It was working fine until yesterday.

Actual Result

image
@Lms24
Copy link
Member

Lms24 commented Feb 22, 2024

Hey @HimanshuRstar thanks for writing in!

According to the issue description you're using @sentry/react. Can you confirm that this is the SDK you're using or are you using @sentry/react-native? Just trying to figure out where to route this issue to ;)

@himujs
Copy link
Author

himujs commented Feb 22, 2024 via email

@Lms24
Copy link
Member

Lms24 commented Feb 22, 2024

No worries all good! I'm just gonna transfer this issue to the React Native SDK repo and tag @krystofwoldrich to please take a look. Thanks!

@Lms24 Lms24 transferred this issue from getsentry/sentry-javascript Feb 22, 2024
@himujs
Copy link
Author

himujs commented Feb 22, 2024

Thanks @Lms24. Appreciate it!

@kahest
Copy link
Member

kahest commented Feb 22, 2024

Hey @himujs can you share the versions of @sentry/react-native and React Native you're using? Also you're indicating that you updated versions/dependencies recently, and that it worked until your change, is that correct? Which versions did you use before that worked?

@himujs
Copy link
Author

himujs commented Feb 22, 2024

Sure @kahest.

So we were earlier using "@sentry/react-native": "^4.13.0" and "react-native": "0.71.11".

This was working fine until yesterday. But it started giving this error - [__NSDictionaryM setObject:forKey:]: key cannot be nil resulting in an app crash either on app start up or after logging in.

We tried upgrading the sentry/react-native to 5.19.0 which is the latest right now but still no luck.

After completely disabling the sentry from our App.tsx and our utility file, we didn't encounter any crashes.

Not sure if it'll help but a similar issue was opened in 2021 - getsentry/sentry-react-native#1367

@himujs
Copy link
Author

himujs commented Feb 22, 2024

Also, we are not using setObjectForKey anywhere in the application. It was only found in deepsearch in sentry - setObject:forKey: in Container+SentryDeepSearch.m.

Hope it helps for more context. 😄

@krystofwoldrich
Copy link
Member

krystofwoldrich commented Feb 23, 2024

This is the mentioned code, but the particular piece has not changed in years.

if ([parentContainer respondsToSelector:@selector(setObject:forKey:)]) {

@himujs Can you share the stack trace of the error?

@philipphofmann @brustolin Based on the current information do you have any thoughts?

@philipphofmann
Copy link
Member

I have no clue what could be causing this, but the Cocoa SDK causes it. I'm moving this to the sentry-cocoa repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

5 participants