Comments (1)
Hi:
This is probably a concurrency issue with Bugsnag, they call back to the default handler, which makes CustomActivityOnCrash work, but they send the crash to their server on an asynchronous thread. If the sending fails, then they store it on disk for the next iteration.
If CustomActivityOnCrash is launched first (it's likely, because it's on the main thread), it kills the app and of course the asynchronous thread launched by Bugsnag is killed too.
What they should do (and I think that's what Crashlytics and ACRA do) is just write to disk on the main thread, then launch the new thread to their server. If the thread gets killed, it will be sent on the next app restart.
Actually you could probably fix this by making their ExceptionHandler
call Client.notify(error, true)
to make it blocking and do their things on the main thread. However, I can't verify that since I don't have a Bugsnag account.
I would suggest submitting a bug report or pull request to Bugsnag to fix this issue. This can also happen on any project with a default exception handler that just kills the app (that's what CustomActivityOnCrash ends up doing).
If you can't change the Bugsnag code, you can create a custom UnhandledExceptionHandler
that calls back to the original handler, and set it after installing CustomActivityOnCrash. There, you can report a handled exception and wait for some milliseconds to give time for Bugsnag to process it. It's not the most elegant of solutions but it can be a workaround.
Check these classes if you want to take a deeper look at it:
https://github.com/bugsnag/bugsnag-android/blob/master/src/main/java/com/bugsnag/android/Bugsnag.java (initializes the client)
https://github.com/bugsnag/bugsnag-android/blob/master/src/main/java/com/bugsnag/android/Client.java (initializes the exception handler and does the send logic)
https://github.com/bugsnag/bugsnag-android/blob/master/src/main/java/com/bugsnag/android/ExceptionHandler.java (the actual exception handler)
I'll close this issue because there is nothing that the library can do to fix this problem. If you find out anything that could make this library handle better these situations please comment again and I'll reopen it.
from customactivityoncrash.
Related Issues (20)
- how to define errorDrawable size? HOT 1
- Debug not stoping on breaking point inside custom error activity HOT 1
- how to solve unfortunately myapp has stopped? HOT 1
- Unable to get provider cat.ereza.customactivityoncrash.provider.CaocInitProvider(solved) HOT 1
- Library hangs completely if the app defines a EventListener and some of its methods crash HOT 1
- OutOfMemoryError: pthread_create HOT 2
- Crash on Android 4.1.2 and 4.4
- incompatible with wrapper shell script HOT 2
- Not working with firebase Crashlytics HOT 3
- Plagiarism of your library HOT 1
- Is it possible to show a fragment instead of activity for crashes? HOT 1
- may provide a callback with the Throwable object
- Not works with FirebaseFirestore HOT 3
- errorActivity will not launch when I do something in eventListener->onLaunchErrorActivity HOT 2
- Deleted everthing on my phone HOT 2
- Is this testable? HOT 1
- Wrong build date info HOT 2
- NoWork at remi note 10x HOT 1
- call api before crash HOT 1
- crash from webrtc framework HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from customactivityoncrash.