You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have following issue:
When my obfuscatedAndroid application in release mode is crashed because of JS error I have 2 errors in Sentry instead of 1: the first one is original JS error that caused app to crash and the second one is JavascriptException. This JavascriptException has the same time as original JS error and also it contains not human readable stack trace. I don't want to see this JavascriptException in my error list.
I want to see only 1 error (without JavascriptException)
Solution:
I debugged that JavascriptException is thrown by ExceptionsManagerModule from com.facebook.react.modules.core package. Also I see that you try to filter this exception (https://github.com/getsentry/sentry-react-native/blob/master/android/src/main/java/io/sentry/RNSentryModule.java#L108). But this approach does not work when I obfuscate my code because JavascriptException class is obfuscated too.
I fixed this bug by adding a rule to proguard.txt file: -keep public class com.facebook.react.common.JavascriptException
But it is not very convenient because I should do the same in every project where I want to use Sentry.
So I recommend you 2 solutions:
You can add the same proguard rule to proguard file of the library;
Instead of hardcoded string you can use the name of appropriate class (com.facebook.react.common.JavascriptException);
The text was updated successfully, but these errors were encountered:
OS:
Platform:
SDK:
@sentry/react-native
react-native-sentry
react-native
version: 0.61.5Init Code:
I have following issue:
When my obfuscated Android application in release mode is crashed because of JS error I have 2 errors in Sentry instead of 1: the first one is original JS error that caused app to crash and the second one is JavascriptException. This JavascriptException has the same time as original JS error and also it contains not human readable stack trace. I don't want to see this JavascriptException in my error list.
Steps to reproduce:
def enableProguardInReleaseBuilds = true
);throw Error('Fake error from JS')
);Actual result:
Expected result:
Solution:
I debugged that JavascriptException is thrown by ExceptionsManagerModule from com.facebook.react.modules.core package. Also I see that you try to filter this exception (https://github.com/getsentry/sentry-react-native/blob/master/android/src/main/java/io/sentry/RNSentryModule.java#L108). But this approach does not work when I obfuscate my code because JavascriptException class is obfuscated too.
I fixed this bug by adding a rule to proguard.txt file:
-keep public class com.facebook.react.common.JavascriptException
But it is not very convenient because I should do the same in every project where I want to use Sentry.
So I recommend you 2 solutions:
com.facebook.react.common.JavascriptException
);The text was updated successfully, but these errors were encountered: