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.captureMessage throws ClassCastException #651

Closed
4 of 7 tasks
ptgamr opened this issue Sep 4, 2019 · 9 comments
Closed
4 of 7 tasks

Sentry.captureMessage throws ClassCastException #651

ptgamr opened this issue Sep 4, 2019 · 9 comments

Comments

@ptgamr
Copy link

ptgamr commented Sep 4, 2019

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

Version: 1.0.1

Init Code:

Sentry.init({
  dsn: 'https://...@sentry.io/...'
});

RN: 0.59.10


I have following issue:

Whenever I call Sentry.captureMessage('any string') it throws me the following error:

Fatal Exception: java.lang.ClassCastException: Value for data cannot be cast from String to ReadableNativeMap
       at com.facebook.react.bridge.ReadableNativeMap.checkInstance + 150(ReadableNativeMap.java:150)
       at com.facebook.react.bridge.ReadableNativeMap.getNullableValue + 142(ReadableNativeMap.java:142)
       at com.facebook.react.bridge.ReadableNativeMap.getMap + 212(ReadableNativeMap.java:212)
       at io.sentry.RNSentryModule.sendEvent + 178(RNSentryModule.java:178)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.facebook.react.bridge.JavaMethodWrapper.invoke + 372(JavaMethodWrapper.java:372)
       at com.facebook.react.bridge.JavaModuleWrapper.invoke + 158(JavaModuleWrapper.java:158)
       at com.facebook.react.bridge.queue.NativeRunnable.run(NativeRunnable.java)
       at android.os.Handler.handleCallback + 907(Handler.java:907)
       at android.os.Handler.dispatchMessage + 105(Handler.java:105)
       at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage + 29(MessageQueueThreadHandler.java:29)
       at android.os.Looper.loop + 216(Looper.java:216)
       at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run + 232(MessageQueueThreadImpl.java:232)
       at java.lang.Thread.run + 784(Thread.java:784)

The same happens for `Sentry.captureEvent({message: 'any string'}) ...

Steps to reproduce:

  • Step: Call

Actual result:

  • Should be able to log the message to Sentry

Expected result:

  • Error thrown, app crash
@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

I can't reproduce this exact issue but I am trying to add a safeguard around this.
Are you adding any breadcrumbs? Because the line in the stack trace indicates it's data in breadcrumb?!

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

I found and fixed the issue, currently releasing 1.0.2, please upgrade to fix the issue.

@HazAT HazAT closed this as completed Sep 4, 2019
@ptgamr
Copy link
Author

ptgamr commented Sep 4, 2019

@HazAT

I tried to update ... but still get the error

2019-09-04-234352_474x599_scrot

I'm currently on v1.0.3

@ptgamr
Copy link
Author

ptgamr commented Sep 4, 2019

I removed the app from the emulator and use react-native run-android again ... still got the error

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

@ptgamr
Copy link
Author

ptgamr commented Sep 4, 2019

@HazAT Cheers, pls let me know when a new version is ready for testing 👍 Thanks!

@HazAT
Copy link
Member

HazAT commented Sep 4, 2019

1.0.4 has been published

@ptgamr
Copy link
Author

ptgamr commented Sep 4, 2019

@HazAT Awesome! It works! Thanks alot for your quick help!

@rdewolff
Copy link

I still have this issue with 1.0.9

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

No branches or pull requests

3 participants