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'm trying to use this repo to get ANR errors and log it into Crashlytics but unfortunately while debugging niether call back for SetANRListener is working nor SetANRInterceptor.
Here is how i'm using it.
in my MainActivity
new ANRWatchDog(1000).SetANRListener(new MyANRListener())
.SetIgnoreDebugger(true)
.SetANRInterceptor(new MyANRInterceptor())
// .SetReportMainThreadOnly()
.Start();
Classes for listeners
public class MyANRListener : ANRWatchDog.IANRListener
{
public void OnAppNotResponding(ANRError error)
{
//Handle the ANR error. log it to Crashlytics:
try
{
Crashlytics.Crashlytics.LogException(error);
} catch(Exception ex)
{
}
}
}
public class MyANRInterceptor : IANRInterceptor
{
string TAG = "ANR: ";
public long Intercept(long duration)
{
long ret = 5000 - duration;
if (ret > 0)
{
Log.Warn(TAG, $"Intercepted ANR that is too short ({duration} ms), postponing for {ret} ms");
}
return ret;
}
public MyANRInterceptor()
{
}
}
I'm trying with Thread.Sleep(10000); i'm getting ANR but none of your listener are getting hit while debugging.
The text was updated successfully, but these errors were encountered:
awmoeder
pushed a commit
to awmoeder/Xamarin.ANRWatchDog
that referenced
this issue
Sep 8, 2023
I'm trying to use this repo to get ANR errors and log it into
Crashlytics
but unfortunately while debugging niether call back for SetANRListener is working nor SetANRInterceptor.Here is how i'm using it.
in my MainActivity
Classes for listeners
I'm trying with
Thread.Sleep(10000);
i'm getting ANR but none of your listener are getting hit while debugging.The text was updated successfully, but these errors were encountered: