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

Add RN Gradle Integration Advance options #11163

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions docs/platforms/react-native/manual-setup/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,35 @@ We enable the Gradle integration in your `android/app/build.gradle` file by addi
apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
```

To change the default behavior, you can pass the following Sentry Gradle Integration options and environmental variables:

```bash
export SENTRY_PROPERTIES=path/to/sentry.properties
export SENTRY_DISABLE_AUTO_UPLOAD=true # Temporarily disable source maps upload

export SENTRY_DIST=1234
export [email protected]
```

```groovy {filename:android/app/build.gradle}
project.ext.sentryCli = [
logLevel: "debug" // Enable verbose debug output
sentryProperties: "path/to/sentry.properties",
flavorAware: false, // When enabled looks for sentry-{flavor}-{build_type}.properties
modulesPaths: [
"node_modules",
"../node_modules",
],
skipCollectModules: false,

collectModulesScript: "path/to/node_modules/@sentry/react-native/dist/js/tools/collectModules.js",
copyDebugIdScript: "path/to/node_modules/@sentry/react-native/scripts/copy-debugid.js",
hasSourceMapDebugIdScript: "path/to/node_modules/@sentry/react-native/scripts/has-sourcemap-debugid.js",
]

apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
```

### Enable Sentry AGP

You can enable native symbol upload and other features by adding the [Sentry Android Gradle Plugin (AGP)](/platforms/android/configuration/gradle) dependency to `android/build.gradle`.
Expand Down Expand Up @@ -180,32 +209,3 @@ sentry {
}
}
```

### Enable Logging for `sentry-cli`

You can also enable logging for `sentry-cli` by adding this config before the above `apply from:` line:

```groovy {filename:android/app/build.gradle}
project.ext.sentryCli = [
logLevel: "debug"
]

apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
```

### Fetch `sentry.properties`

We also support fetching different `sentry.properties` files for different flavors. For that, you need to add:

```groovy {filename:android/app/build.gradle}
project.ext.sentryCli = [
logLevel: "debug",
flavorAware: true
]

apply from: "../../node_modules/@sentry/react-native/sentry.gradle"
```

The corresponding flavor files should also be placed within the specific build type folder where you intend to use them. For example, the "Android demo release" flavor would be `react-native/android/sentry-demo-release.properties`.

We recommend leaving `logLevel: "debug"` since we look for specific `sentry.properties` files depending on your flavor's name.
Comment on lines -183 to -211
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you remove this on purpose?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading