Skip to content
Open
Show file tree
Hide file tree
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
86 changes: 86 additions & 0 deletions docs/platforms/android/migration/gradle-plugin-v1-to-v2.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: Migrate from sentry-android-gradle-plugin 1.x to 2.0.0
sidebar_order: 8930
description: "Learn about migrating from Sentry Android Gradle Plugin 1.x to 2.0.0."
---

The `io.sentry.android.gradle` >= `2.0.0` requires [Android Gradle Plugin >= 4.0.0](https://developer.android.com/studio/releases/gradle-plugin#4-0-0).

The `io.sentry.android.gradle` >= `2.0.0` must be applied to the `app/build.gradle` module (or the module that has `com.android.application` plugin applied).

The `io.sentry.android.gradle` >= `2.0.0` publishes the Gradle Plugin Marker to Maven Central. As a result, you no longer need to set the `classpath`.

_Old_:

```groovy
buildscript {
repositories {
mavenCentral()
}

dependencies {
classpath 'io.sentry:sentry-android-gradle-plugin:{version}'
}
}

apply plugin: 'io.sentry.android.gradle'
```

_New_:

```groovy
plugins {
id "io.sentry.android.gradle" version "{version}"
}

buildscript {
repositories {
mavenCentral()
}
}
```

```kotlin
plugins {
id("io.sentry.android.gradle") version "{version}"
}

buildscript {
repositories {
mavenCentral()
}
}
```

The `io.sentry.android.gradle` has been rewritten in Kotlin. As a result, the Groovy or Kotlin DSL syntax has slightly changed.

The `autoProguardConfig` flag has been removed, the Android SDK >= `2.0.0` version already merges the ProGuard rules automatically.

_Old_:

```groovy
sentry {
autoProguardConfig false
autoUpload true
uploadNativeSymbols false
includeNativeSources false
}
```

_New_:

```groovy
sentry {
autoUpload = true
uploadNativeSymbols = false
includeNativeSources = false
}
```

```kotlin
sentry {
autoUpload.set(true)
uploadNativeSymbols.set(false)
includeNativeSources.set(false)
}
```
75 changes: 75 additions & 0 deletions docs/platforms/android/migration/gradle-plugin-v2-to-v3.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Migrate from sentry-android-gradle-plugin 2.x to 3.0.0
sidebar_order: 8925
description: "Learn about migrating from Sentry Android Gradle Plugin 2.x to 3.0.0."
---

The `io.sentry.android.gradle` >= `3.0.0` requires [Android Gradle Plugin >= 7.0.0](https://developer.android.com/studio/releases/gradle-plugin#7-0-0). For older versions of the Android Gradle Plugin, use `io.sentry.android.gradle:2.+`.

## includeProguardMapping

The `autoUpload` flag has been deprecated in favor of two new options:

- `includeProguardMapping` - Disables/enables Proguard mapping functionality. When enabled, generates a UUID and attempts to upload a Proguard mapping associated with that UUID to Sentry. When `autoUploadProguardMapping` is disabled, the plugin will only generate a `sentry-debug-meta.properties` file containing UUID, which can later be used to manually upload the mapping using, for example [sentry-cli](/cli/dif/#proguard-mapping-upload).
- `autoUploadProguardMapping` - Defines whether the gradle plugin should attempt to auto-upload the mapping file to Sentry.
When `includeProguardMapping` is disabled, this flag has no effect.

_Old_:

```groovy
sentry {
autoUpload = false
}
```

```kotlin
sentry {
autoUpload.set(false)
}
```

_New_:

```groovy
sentry {
includeProguardMapping = true
autoUploadProguardMapping = false
}
```

```kotlin
sentry {
includeProguardMapping.set(true)
autoUploadProguardMapping.set(false)
}
```

## tracingInstrumentation

The `io.sentry.android.gradle` enables the tracing instrumentation (via bytecode manipulation) for `androidx.sqlite` and `androidx.room` libraries by default, to disable it, see the code snippet below.

```groovy
sentry {
// Enable or disable the tracing instrumentation.
// Does auto instrumentation for 'androidx.sqlite' and 'androidx.room' libraries.
// It starts and finishes a Span within any CRUD operation.
// Default is enabled.
// Only available v3.0.0 and above.
tracingInstrumentation {
enabled = false
}
}
```

```kotlin
sentry {
// Enable or disable the tracing instrumentation.
// Does auto instrumentation for 'androidx.sqlite' and 'androidx.room' libraries.
// It starts and finishes a Span within any CRUD operation.
// Default is enabled.
// Only available v3.0.0 and above.
tracingInstrumentation {
enabled.set(false)
}
}
```
24 changes: 24 additions & 0 deletions docs/platforms/android/migration/gradle-plugin-v3-to-v4.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Migrate from sentry-android-gradle-plugin 3.x to 4.0.0
sidebar_order: 8905
description: "Learn about migrating from Sentry Android Gradle Plugin 3.x to 4.0.0."
---

## Breaking Changes

- Bumped Sentry Android SDK to `7.0.0`. Refer to the [migration guide for sentry-android 6.x to 7.0.0](/platforms/android/migration/v6-to-v7/) for details about changes to the SDK.
- Renamed `experimentalGuardsquareSupport` flag to `dexguardEnabled`.

## Sentry Android SDK Compatibility

You must use Sentry Gradle plugin 4.+ together with the Sentry Android SDK 7.+ otherwise, it might crash at runtime due to binary incompatibility. If you can't do that for some reason, you can specify the Sentry version via the plugin config block:

```kotlin
sentry {
autoInstallation {
sentryVersion.set("7.0.0")
}
}
```

Similarly, if you have a Sentry SDK (e.g. `sentry-android-core`) dependency on one of your Gradle modules and you're updating it to 7.+, make sure the Gradle plugin is at 4.+, or specify the SDK version as shown in the snippet above.
Loading
Loading