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

Sentry.sendEvent throws ClassCastException #674

Closed
2 of 4 tasks
jacquesdev opened this issue Sep 30, 2019 · 5 comments · Fixed by #749
Closed
2 of 4 tasks

Sentry.sendEvent throws ClassCastException #674

jacquesdev opened this issue Sep 30, 2019 · 5 comments · Fixed by #749

Comments

@jacquesdev
Copy link

jacquesdev commented Sep 30, 2019

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native
  • react-native-sentry

react-native version: 0.59.10

Init Code:

import * as Sentry from '@sentry/react-native'
Sentry.init({ dsn: SENTRY_DSN, environment: ENV })

I have the following issue:

I'm getting warnings on the Google Play Store about crashes related to the new sentry plugin.

Value for message cannot be cast from ReadableNativeMap to String

java.lang.ClassCastException: 
  at com.facebook.react.bridge.ReadableNativeMap.checkInstance (ReadableNativeMap.java:150)
  at com.facebook.react.bridge.ReadableNativeMap.getNullableValue (ReadableNativeMap.java:142)
  at com.facebook.react.bridge.ReadableNativeMap.getString (ReadableNativeMap.java:192)
  at io.sentry.RNSentryModule.sendEvent (RNSentryModule.java:209)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:372)
  at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:158)
  at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method)
  at android.os.Handler.handleCallback (Handler.java:873)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:29)
  at android.os.Looper.loop (Looper.java:193)
  at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run (MessageQueueThreadImpl.java:232)
  at java.lang.Thread.run (Thread.java:764)

It looks like it's similar to this issue #651, however, I'm already on v1.04.

@Kebabpizza
Copy link

I have the same issue, it started after going to @sentry/react-native 1.0.4 and react-native 0.59.10, from react-native-sentry 0.39.1 and react-native 0.57.8

@HazAT
Copy link
Member

HazAT commented Oct 2, 2019

Can you upgrade to 1.0.6 and see if the error is still there?

@jacquesdev
Copy link
Author

Since the only way for me to test this is to upload my app to production, I'm afraid I can't take that risk, since I risk losing many customers if the app starts crashing on them. Is there any particular commit/fix in 1.0.5 or 1.06 that would fix this issue?

@rdewolff
Copy link

On 1.0.9 with React Native 0.59.9 I have the same error.

@altany
Copy link

altany commented Jan 8, 2020

Any update on this? Would really like to upgrade to @sentry/react-native and this error is stoping us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants