OS:
Platform:
SDK:
@sentry/react-nativereact-native-sentrySDK version: 1.2.1
react-native version: 0.61.5
Are you using Expo?
Are you using sentry.io or on-premise?
Configuration:
Sentry.init({
dsn: SENTRY_DSN,
environment: ENV,
})
I have the following issue:
I recently upgraded to 1.2.1 of this plugin, and suddenly started to get ApplicationNotResponding errors. According to the java documentation here https://docs.sentry.io/clients/java/integrations/#android, it looks like it's an optional setting that you have to turn on (and that it waits 5 seconds before sending the error).
I have not turned it on, and it seems to complain after 4 seconds.
I realise I don't have the latest version of sentry, and will look at getting that updated soon, but I just wanted to confirm if that was a known issue, and perhaps has been fixed.
If not, can you please confirm why it seems to be enabled by default, since the java docs at least seems to suggest it's an opt in option.
I am using this in my sentry.properties, defaults.url=https://sentry.io/, but assuming that should be as the documentation mentioned.
An example title of the error is ApplicationNotResponding: Application Not Responding for at least 4000 ms.
Update:
I decided to use the ANR error by setting the timeout to 15seconds, which is getting ignored, I'm still getting alerts after 4 seconds. I'm going to assume then that explicitly disabling is going to also have no effect.
The biggest problem of all. My quota of events is going to run out in three days, which means sentry becomes useless to me.
facing similar issue
Yeah, we also started to see this. In a single day I had like 20 new emails about ApplicationNotResponding: Application Not Responding for at least 4000 ms. errors. All with different stacktraces, no breadcrumbs and the user ids are the default ones and not the ones I set on the App during start. Is this normal?
Can confirm I have the same issue since an update to 1.3.2, I receive a lot of error from the same user.

@HazAT, could you please investigate. Since it seems I am unable to turn this off (or get it working as expected), at this rate I'll run out of my event quota in three days.
hey @jacquesdev please look at https://docs.sentry.io/platforms/android/#configuration-options Application Not Responding (ANR) section, the link you've shared is from the old Android SDK version.
So to disable it, you need to add in your AndroidManifest file:
<meta-data android:name="io.sentry.anr.enable" android:value="false" />
To change the interval, you have to:
<meta-data android:name="io.sentry.anr.timeout-interval-mills" android:value="15000" /> // if 15 seconds
could one of you share which device is happening and which Android API level is? or even better, a link to the issue on sentry.io
I'm not sure if this is a bug or you are just doing heavy work on the main thread, thanks.
Thank you for the AndroidManifest fix, I will try it out.
For me it's happening with SM-G960F and SM-G950F on Android 9 and 10.
@marandaneto, can you please confirm in which version of the react-native plugin this was changed? Ie in which version did it start using the updated sdk where ANR is turned on by default?
hey @jacquesdev since https://github.com/getsentry/sentry-react-native/releases/tag/1.3.0
@jacquesdev btw I'd recommend updating the issue description as you stated SDK version: 1.2.1 and it's for sure >= 1.3.0 thanks
Yeah, we also started to see this. In a single day I had like 20 new emails about
ApplicationNotResponding: Application Not Responding for at least 4000 ms.errors. All with different stacktraces, no breadcrumbs and the user ids are the default ones and not the ones I set on the App during start. Is this normal?
hey @reyalpsirc I'd recommend you to open a new issue about the and the user ids are the default ones and not the ones I set on the App during start.
hey, @brian-perlego could you share a link to sentry.io or a full stack trace of an unexpected ANR report? I can't really judge if it's a bug on our end or if your App. is just doing heavy work on the main thread.
could any of you create a test repo where you can see if it's actually misfiring ANR reports? I couldn't reproduce by myself, it only fires if it does heavy work on the main thread which then is the right behaviour.
@marandaneto. I am using v1.2.1 of this plugin. It looks like that it is potentially using 1.3.1 of the sdk, not sure but can you please confirm? #796 confirms its 1.2.1, so not an issue with my bug report.
Also @marandaneto - am I right to say this feature is opt-in? I should not be getting it automatically, which is why I believe it is a bug.
@marandaneto - here is an id example of my issue:
1566808667
Also @marandaneto - am I right to say this feature is opt-in? I should not be getting it automatically, which is why I believe it is a bug.
no, this feature is opt-out as stated on https://docs.sentry.io/platforms/android/#configuration-options
pay attention at: If you do not want to monitor the ANR, please add the following line into your manifest.
<application>
<meta-data android:name="io.sentry.anr.enable" android:value="false" />
</application>
@marandaneto. I am using v1.2.1 of this plugin. It looks like that it is potentially using 1.3.1 of the sdk, not sure but can you please confirm? #796 confirms its 1.2.1, so not an issue with my bug report.
I think there's a problem in your build script or something, sentry-react-native only starts using sentry-android-2.0.0 >= 1.3.0 so it can't be 1.2.1, please double-check it, maybe clean it up and use the wizard again?
@marandaneto - here is an id example of my issue:
1566808667
what's the org?
@marandaneto - org is olio
@jacquesdev thanks, what's about the SDK version? have you double-checked it?

this is a SS from an issue of yours, so if you still see in your code 1.2.1, I'd suggest to clean it up and set it up again.
Thanks @marandaneto, it seems the version we were using in our package lock file was not the same one as specificied in our package.json. We have now fixed
Still happening to us on [email protected] and @sentry/[email protected], with sentry SDK version 2.0.2 as seen in the issue detail. Getting thousands of events, pretty sure none of them is an actual ANR.
EDIT
Could anyone confirm that the following still works with @sentry/[email protected] and SDK version 2.0.2?
<meta-data android:name="io.sentry.anr.enable" android:value="false" />
@39otrebla @sentry/[email protected] should be using the Android SDK v2.2.0 and not v2.0.2, if you downgrade it manually, undo it.
if it didn't upgrade automatically when you upgraded the @sentry/[email protected], please raise a new issue, also run the wizard again, this issue is resolved but it seems you are using an older version of the Android SDK.
Most helpful comment
Can confirm I have the same issue since an update to
1.3.2, I receive a lot of error from the same user.