nativescript-community / sentry

A cross-platform application monitoring tool, with a focus on error reporting.
Apache License 2.0
14 stars 7 forks source link

Errors on 4.6.2 in Android's init #13

Open theobat opened 1 year ago

theobat commented 1 year ago
 Catching on startWithOptions, calling callback Error: Cannot convert boolean to Ljava/lang/Boolean; at index 0
  JS: Garmin: garmin module started
  JS: captureMsg d3fa5208745d4f148d5e5a46d6efcaab TEST Login mounted,  undefined
  JS: captureEnvelope error TypeError: Cannot read property 'getOutboxPath' of undefined TypeError: Cannot read property 'getOutboxPath' of undefined
  JS:     at c (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:10078:65)
  JS:     at Object.e.sendEnvelope (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:10047:7)
  JS:     at file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9897:84
  JS:     at Object.add (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9706:7)
  JS:     at Dt.send (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9897:72)
  JS:     at kt._sendEnvelope (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9924:44)
  JS:     at kt.sendEvent (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9806:6)
  JS:     at file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:9863:125
  JS:     at Array.<anonymous> (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:15961:132)
  JS:     at file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:15972:56
  JS: Sentry Logger [error]: Error while sending event: TypeError: Cannot read property 'flushSendEvent' of undefined

Which platform(s) does your issue occur on?

Working to resolve this right now.

farfromrefug commented 1 year ago

Can you try and get the callstack from the first error ?(add error.stack to the console log)

theobat commented 1 year ago

The trace is not great because I can only test in prod :

 JS: Error starting Sentry Error: Cannot convert boolean to Ljava/lang/Boolean; at index 0
  JS: Catching on startWithOptions, calling callback test Error: Cannot convert boolean to Ljava/lang/Boolean; at index 0 Error: Cannot convert boolean to Ljava/lang/Boolean; at index 0
  JS:     at Object.configure (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:265:3)
  JS:     at Object.e.initNativeSdk (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:255:47)
  JS:     at F._initNativeSdk (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:107:16)
  JS:     at new F (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:93:6)
  JS:     at r (file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:15029:7)
  JS:     at Module.Y (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:181:189)
  JS:     at T.start (file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:1231:3)

But the error is caused by the debug flag :

 // this doesn't work : 
                 Sentry.init({
                    debug: true,
 // this works : 
                 Sentry.init({
                    debug: new java.lang.Boolean(true),
theobat commented 1 year ago

But then I get other errors :

  JS: Catching on startWithOptions, calling callback test Error: com.tns.NativeScriptException: Calling js method create failed
  JS: Error: java.lang.Exception: Failed resolving constructor for class 'io.sentry.transport.RateLimiter' with 1 parameters. Check the number and type of arguments.
  JS: Primitive types need to be manually wrapped in their respective Object wrappers.
  JS: If you are creating an instance of an inner class, make sure to always provide reference to the outer `this` as the first argument. e.initNativeSdk(file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:255:47)
  JS:   at _initNativeSdk(file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:107:16)
  JS:   at F(file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:93:6)
  JS:   at r(file:///data/data/com.corefortech.app.prod2/files/app/vendor.js:15029:7)
  JS:   at Y(file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:181:189)
  JS:   at start(file:///data/data/com.corefortech.app.prod2/files/app/bundle.js:1231:3)

I'm investigating on this one now

farfromrefug commented 1 year ago

@theobat as i told you on slack you must be forcing the sentry android lib version in App_Resources/Android/before-plugins.gradle either remove it or upgrade to 6.5.0 or +