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

Watchdog send error to Fabric (Crashlytics) #23

Closed
giaotuancse opened this issue May 8, 2017 · 5 comments
Closed

Watchdog send error to Fabric (Crashlytics) #23

giaotuancse opened this issue May 8, 2017 · 5 comments

Comments

@giaotuancse
Copy link

Hello,
I implemented WathchDog in my project. Boot seem like it has problem with WatchDog version 1.0.3.
The logs were not send to Fabric although I catched the error . Please help me check it.
Here's the code
new ANRWatchDog().setANRListener(new ANRWatchDog.ANRListener() {
@OverRide
public void onAppNotResponding(ANRError arg0) {
Crashlytics.getInstance().core.logException(arg0);
}
}).start();

Thank you.

@SalomonBrys
Copy link
Owner

There is nothing wrong in your code.
The truth must be elsewhere...

@giaotuancse
Copy link
Author

Can you help me a little check on your side?

@ndahlquist
Copy link
Contributor

Have you tried testing (by printing via logcat) whether the onAppNotResponding callback is invoked? This would help to determine whether the issue is on the ANR-Watchdog side, or on the Crashlytics side.

@GajanandSwamy
Copy link

GajanandSwamy commented Jun 23, 2017

i used like this

new ANRWatchDog().setANRListener(new ANRWatchDog.ANRListener() {
@OverRide
public void onAppNotResponding(ANRError error) {
// Handle the error. For example, log it to HockeyApp:
Intent intent = new Intent(MainActivity.this, SecondActivity.class);
startActivity(intent);
}
}).start();

but app is crashing

@SalomonBrys
Copy link
Owner

Yep, that is intended.
This is a crash handler. Meaning that, when it is called, the app has ANR'd, the boat has sunk, it's too late.
Any interraction with the UI will not work as the UI thread is still not responding !

If you need to start a new activity, you can, but in a new process.

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

4 participants