Skip to content

Commit cc5c5a5

Browse files
authored
RN: Adds RN Expo Sentry Android Gradle Plugin subpage (#12371)
1 parent 9626c35 commit cc5c5a5

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

docs/platforms/react-native/manual-setup/expo.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ To verify that everything is working as expected, build the `Release` version of
125125

126126
- [Learn how to upload source maps for native builds and Expo Updates](/platforms/react-native/sourcemaps/uploading/expo/)
127127
- [Add automatic tracing with Expo Router](/platforms/react-native/tracing/instrumentation/expo-router/)
128+
- [Configure the Sentry Android Gradle Plugin](/platforms/react-native/manual-setup/expo/gradle/)
128129

129130
## Notes
130131

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
title: Sentry Android Gradle Plugin (AGP)
3+
description: "Learn how to configure the Sentry Android Gradle Plugin to automatically upload source maps and debug symbols for your Expo project."
4+
---
5+
6+
<Alert>
7+
8+
The **Sentry AGP** is still an experimental option of the Sentry React Native Expo plugin. If you encounter any issues please let us know via a GitHub ticket.
9+
10+
</Alert>
11+
12+
To enable the plugin modify the Expo application configuration and add the `enableAndroidGradlePlugin` option in the `@sentry/react-native/expo` plugin section.
13+
14+
```javascript {tabTitle:app.json/app.config.json} {10-12}
15+
{
16+
"expo": {
17+
"plugins": [
18+
[
19+
"@sentry/react-native/expo",
20+
{
21+
"url": "https://sentry.io/",
22+
"project": "___PROJECT_SLUG___",
23+
"organization": "___ORG_SLUG___"
24+
"experimental_android": {
25+
"enableAndroidGradlePlugin": true,
26+
}
27+
}
28+
],
29+
}
30+
}
31+
```
32+
33+
## Configuration options
34+
35+
You can configure the Sentry Android Gradle Plugin by passing an options object to the `experimental_android` key in the plugin configuration.
36+
37+
```javascript {tabTitle:app.json/app.config.json}
38+
{
39+
"expo": {
40+
...
41+
"plugins": [
42+
[
43+
"@sentry/react-native/expo",
44+
{
45+
...
46+
"experimental_android": {
47+
"enableAndroidGradlePlugin": true,
48+
"autoUploadProguardMapping": true,
49+
"includeProguardMapping": true,
50+
"dexguardEnabled": true,
51+
"uploadNativeSymbols": true,
52+
"autoUploadNativeSymbols": true,
53+
"includeNativeSources": true,
54+
"includeSourceContext": true,
55+
}
56+
}
57+
],
58+
...
59+
}
60+
}
61+
```
62+
63+
### autoUploadProguardMapping
64+
65+
This option specifies whether the plugin should attempt to auto-upload the mapping file to Sentry or not. If disabled the plugin will run a dry-run and just generate a UUID. The mapping file has to be uploaded manually via sentry-cli in this case. Default is enabled.
66+
67+
### includeProguardMapping
68+
69+
Disables or enables the handling of Proguard mapping for Sentry. If enabled the plugin will generate a UUID and will take care of uploading the mapping to Sentry. If disabled, all the logic related to proguard mapping will be excluded. Default is enabled.
70+
71+
### dexguardEnabled
72+
73+
Experimental flag to turn on support for GuardSquare's tools integration (Dexguard and External Proguard). If enabled, the plugin will try to consume and upload the mapping file produced by Dexguard and External Proguard. Default is disabled.
74+
75+
### uploadNativeSymbols
76+
77+
Disables or enables the automatic configuration of Native Symbols for Sentry. This executes sentry-cli automatically so you don't need to do it manually. Default is disabled.
78+
79+
### autoUploadNativeSymbols
80+
81+
Defines whether the plugin should attempt to auto-upload the native debug symbols to Sentry or not. If disabled the plugin will run a dry-run. Default is enabled.
82+
83+
### includeNativeSources
84+
85+
Does or doesn't include the source code of native code for Sentry. This executes sentry-cli with the --include-sources param. automatically so you don't need to do it manually. This option has an effect only when `uploadNativeSymbols` is enabled. Default is disabled.
86+
87+
### includeSourceContext
88+
89+
Generates a JVM (Java, Kotlin, etc.) source bundle and uploads your source code to Sentry. This enables source context, allowing you to see your source code as part of your stack traces in Sentry.

0 commit comments

Comments
 (0)