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
## 4. (Optional) Configure Crashlytics NDK and GWP-ASan support
61
+
62
+
### Enable NDK Crash Reporting
61
63
62
64
Crashlytics NDK reporting allows you to capture Native Development Kit crashes, e.g. in React Native this will capture
63
65
crashes originating from the Yoga layout engine.
64
66
65
-
Add the `firebaseCrashlytics` block line to the `android/app/build.gradle` file:
67
+
To enable NDK crash reporting, add the following to your `firebase.json` file:
68
+
69
+
```json
70
+
{
71
+
"react-native": {
72
+
"crashlytics_ndk_enabled": true
73
+
}
74
+
}
75
+
```
76
+
77
+
When `crashlytics_ndk_enabled` is set to `true`, React Native Firebase will automatically:
78
+
- Enable NDK crash reporting in the manifest
79
+
- Configure automatic native symbol upload for all release build variants
80
+
81
+
> **Note**: The automatic symbol upload configuration works with standard release builds and custom build flavors (e.g., `playRelease`, `premiumRelease`). Any build variant with "release" in its name will have symbol upload enabled.
82
+
83
+
If you need to manually configure symbol upload or override the automatic configuration, you can add the `firebaseCrashlytics` block to your `android/app/build.gradle` file:
66
84
67
85
```groovy
68
86
android {
69
87
// ...
70
88
71
89
buildTypes {
72
90
release {
73
-
/* Add the firebaseCrashlytics extension (by default,
74
-
* it's disabled to improve build speeds) and set
75
-
* nativeSymbolUploadEnabled to true along with a pointer to native libs. */
[GWP-ASan](https://developer.android.com/ndk/guides/gwp-asan) (GWP-AddressSanitizer) is a native memory allocator feature that helps detect heap memory errors. You can configure its behavior using `firebase.json`:
104
+
105
+
```json
106
+
{
107
+
"react-native": {
108
+
"crashlytics_gwp_asan_mode": "default"
109
+
}
110
+
}
111
+
```
112
+
113
+
Available values:
114
+
-`"default"` - The default behavior (system-determined, typically enabled for a small percentage of devices)
115
+
-`"never"` - Disable GWP-ASan completely
116
+
-`"always"` - Enable GWP-ASan on all devices (useful for testing, but not recommended for production due to performance impact)
117
+
118
+
> **Recommended**: Use `"default"` for production builds to get memory error detection with minimal performance impact.
119
+
87
120
## 5. Rebuild the project
88
121
89
122
Once the above steps have been completed, rebuild your Android project:
which is enabled by default but will require a change as described in that link to enable symbol upload.
216
+
which allows Crashlytics to capture crashes originating from the Yoga layout engine used by React Native.
217
217
218
-
This allows Crashlytics to capture crashes originating from the Yoga layout engine used by React Native.
218
+
**Note:** NDK reporting is disabled by default due to memory usage concerns.
219
219
220
-
You can disable Crashlytics NDK in your `firebase.json` config.
220
+
### Enable NDK Reporting
221
+
222
+
To enable NDK crash reporting, add the following to your `firebase.json`:
223
+
224
+
```json
225
+
// <project-root>/firebase.json
226
+
{
227
+
"react-native": {
228
+
"crashlytics_ndk_enabled": true
229
+
}
230
+
}
231
+
```
232
+
233
+
When enabled, React Native Firebase will automatically:
234
+
- Enable NDK crash reporting in your Android app
235
+
- Configure automatic native symbol upload for all release build variants
236
+
237
+
For more details on Android setup, see the [Android Setup](/crashlytics/android-setup) documentation.
238
+
239
+
### Configure GWP-ASan
240
+
241
+
[GWP-ASan](https://developer.android.com/ndk/guides/gwp-asan) (GWP-AddressSanitizer) is a native memory allocator feature that helps detect heap memory errors. You can configure its behavior:
221
242
222
243
```json
223
244
// <project-root>/firebase.json
224
245
{
225
246
"react-native": {
226
-
"crashlytics_ndk_enabled": false
247
+
"crashlytics_gwp_asan_mode": "default"
227
248
}
228
249
}
229
250
```
230
251
252
+
Available values:
253
+
-`"default"` - System-determined (recommended for production)
254
+
-`"never"` - Disable GWP-ASan completely
255
+
-`"always"` - Enable on all devices (for testing only)
React Native Crashlytics module by default installs a global javascript exception handler, and it records a crash with a javascript stack trace any time an unhandled javascript exception is thrown. Sometimes it is not desirable behavior since it might duplicate issues in combination with the default mode of javascript global exception handler chaining. We recommend leaving JS crashes enabled and turning off exception handler chaining. However, if you have special crash handling requirements, you may disable this behavior by setting the appropriate option to false:
0 commit comments