Skip to content

Commit 423d22f

Browse files
committed
feat: Update README
1 parent f18531a commit 423d22f

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

README.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,45 @@ It shows you a pretty error screen when your Android App crashes, instead of a b
88

99
Follow the [Installation Instructions](#installation) to set it up.
1010

11-
Now when an uncaught exception is thrown in your application, you shall be greeted with a screen similar to this:
11+
_Remember to use WhatTheStack only in debug builds of your app by using `debugImplementation` instead of `implementation.`_
12+
13+
Now when an uncaught exception is thrown in your application, you will be greeted with a screen similar to this:
1214

1315
<img src="media/screenshot.jpeg" width="360px" height="640px"/>
1416

1517
### Disabling automatic initialization
1618

17-
`WhatTheStack` initializes automatically when your application starts. It accomplishes this using a `ContentProvider`.
19+
`WhatTheStack` initializes automatically when your application starts. It accomplishes this using Jetpack's App Startup library.
1820

19-
If you want to disable automatic initialization, you should disable the initialization content provider of this library by adding the following lines to your application's `AndroidManifest.xml` file:
21+
If you want to disable automatic startup, add the following lines to your Manifest file:
2022

2123
```xml
2224
<provider
23-
android:name="com.haroldadmin.whatthestack.WhatTheStackInitProvider"
24-
android:authorities="${applicationId}.WhatTheStackInitProvider"
25-
tools:node="remove" />
25+
android:name="androidx.startup.InitializationProvider"
26+
android:authorities="${applicationId}.androidx-startup"
27+
android:exported="false"
28+
tools:node="merge">
29+
<meta-data android:name="com.haroldadmin.whatthestack.WhatTheStackInitializer"
30+
android:value="androidx.startup"
31+
tools:node="remove"/>
32+
</provider>
2633
```
2734

2835
## Under the hood
2936

30-
This library works by setting a default `UncaughtExceptionHandler` on your app, and running a service to receive notifications about these exceptions.
37+
This library works by setting a default `UncaughtExceptionHandler` on your app, and running a service to receive notifications about thrown exceptions.
3138

32-
When an uncaught exception is thrown, it is caught by this handler and sent to the service running in a _different process than your application_ to parse and display the information about the exception to you.
39+
When an uncaught exception is thrown, it is caught by this handler and sent to the service running in a _different process than your application_ to parse and display information about the exception.
3340

3441
Running in a separate process is important because when an uncaught exception is thrown, the main thread of your application becomes unable to perform any UI related actions, and hence can't launch an intent to display the error screen shipped with this library.
3542

43+
## Breaks Crash Reporting in Debug builds
44+
45+
WhatTheStack works by replacing the default uncaught exception handler in your app's process.
46+
Unfortunately, crash reporting libraries such as Firebase Crashlytics also work in this manner.
47+
Since there can only be one default uncaught exception handler and there is no fixed order of initialization for them, WhatTheStack prevents crash reporting libraries from working properly in debug builds.
48+
This is not a problem for most of the time as crash reporting is commonly used only in release builds.
49+
3650
## Installation
3751

3852
Add Jitpack repository in your root `build.gradle` file:
@@ -60,5 +74,3 @@ It is not recommended to use WhatTheStack in anything other than debug builds of
6074
## Contributions
6175

6276
Contributions to this library are very welcome.
63-
64-
I threw this together over one weekend, and it hasn't been thoroughly tested. Community validation and contributions would therefore be great.

0 commit comments

Comments
 (0)