Skip to content

Commit 8d2b9d7

Browse files
authored
ref: Simplify gradle docs (#1503)
1 parent 969595b commit 8d2b9d7

File tree

1 file changed

+2
-63
lines changed
  • src/collections/_documentation/platforms/android

1 file changed

+2
-63
lines changed

src/collections/_documentation/platforms/android/index.md

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -242,69 +242,8 @@ sentry {
242242
}
243243
```
244244

245-
### Manual Integration
246-
247-
If you choose not to use the Gradle integration, you may handle the processing and upload steps manually. However, we highly recommend that you use the Gradle integration, if at all possible.
248-
249-
### ProGuard UUIDs
250-
251-
After ProGuard files generate, you will need to embed the UUIDs of the ProGuard mapping files in a properties file named `sentry-debug-meta.properties` in the assets folder. The Java SDK will look for the UUIDs there to link events to the correct mapping files on the server-side.
252-
253-
Sentry calculates UUIDs for ProGuard files. For more information about how this works, see [ProGuard UUIDs]({%- link _documentation/workflow/debug-files.md -%}#proguard-uuids).
254-
255-
`sentry-cli` can write the `sentry-debug-meta.properties` file for you:
256-
257-
```bash
258-
sentry-cli upload-proguard \
259-
--android-manifest app/build/intermediates/manifests/full/release/AndroidManifest.xml \
260-
--write-properties app/build/intermediates/assets/release/sentry-debug-meta.properties \
261-
--no-upload \
262-
app/build/outputs/mapping/{buildVariant}/mapping.txt
263-
```
264-
265-
This file needs to be in your APK, so **run the script before the APK is packaged**. You can do that by creating a Gradle task that runs before the dex packaging.
266-
267-
You can, for example, add a Gradle task after the ProGuard step and before the dex packaging. The dex packaging executes `sentry-cli` to validate, process the mapping files, and write the UUIDs into the properties file:
268-
269-
```groovy
270-
gradle.projectsEvaluated {
271-
android.applicationVariants.each { variant ->
272-
def variantName = variant.name.capitalize();
273-
def proguardTask = project.tasks.findByName(
274-
"transformClassesAndResourcesWithProguardFor${variantName}")
275-
def dexTask = project.tasks.findByName(
276-
"transformClassesWithDexFor${variantName}")
277-
def task = project.tasks.create(
278-
name: "processSentryProguardFor${variantName}",
279-
type: Exec) {
280-
workingDir project.rootDir
281-
commandLine *[
282-
"sentry-cli",
283-
"upload-proguard",
284-
"--write-properties",
285-
"${project.rootDir.toPath()}/app/build/intermediates/assets" +
286-
"/${variant.dirName}/sentry-debug-meta.properties",
287-
variant.getMappingFile(),
288-
"--no-upload"
289-
]
290-
}
291-
dexTask.dependsOn task
292-
task.dependsOn proguardTask
293-
}
294-
}
295-
```
296-
297-
Alternatively, you can generate a UUID upfront yourself and then force Sentry to honor that UUID after upload. However, this is **strongly discouraged**.
298-
299-
### Uploading ProGuard Files
300-
301-
Finally, manually upload the ProGuard files with `sentry-cli` as follows:
302-
303-
```bash
304-
sentry-cli upload-proguard \
305-
--android-manifest app/build/intermediates/manifests/full/release/AndroidManifest.xml \
306-
app/build/outputs/mapping/{buildVariant}/mapping.txt
307-
```
245+
And that's it! Now when you build your app, the plugin will upload the proguard/R8 mappings,
246+
source bundle, and native symbols, as you configured them to Sentry.
308247

309248
## Releases
310249

0 commit comments

Comments
 (0)