Skip to content

Commit 8f29d0f

Browse files
Troubleshooting Guide for mixed versions in Java / Android SDK (#13140)
* Troubleshooting Guide for mixed versions in Java / Android SDK * Update docs/platforms/android/troubleshooting/mixed-versions/index.mdx * Update docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx * link BOM docs * Apply suggestions from code review Co-authored-by: Alex Krawiec <[email protected]> --------- Co-authored-by: Alex Krawiec <[email protected]>
1 parent 428ab24 commit 8f29d0f

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

docs/platforms/android/troubleshooting/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,5 @@ This problem is only relevant to these specific versions: `sentry-android-core`
318318
</Alert>
319319

320320
Check [this issue](https://github.com/getsentry/sentry-android-gradle-plugin/issues/329) for more details.
321+
322+
<PageGrid />
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
title: Mixed Versions
3+
description: "Troubleshoot and resolve mixed Android SDK dependency versions."
4+
sidebar_order: 1000
5+
---
6+
7+
Using multiple Android SDK dependencies with mixed versions is not supported as it is very likely to lead to a crash later on. For this reason we chose to crash the application on SDK init instead.
8+
9+
## Multiple Dependencies With Mixed Versions
10+
11+
The following snippet shows a mixed version conflict caused by using `sentry` with version `8.6.0` and `sentry-android` with version `8.7.0`. To fix the issue, set the same version for all dependencies or <PlatformLink to="/configuration/bill-of-materials/">use `sentry-bom`</PlatformLink>. This may also happen if you are using an internal library which has a different version defined.
12+
13+
```groovy {tabTitle:Gradle}{filename:build.gradle}
14+
implementation('io.sentry:sentry:8.6.0')
15+
implementation('io.sentry:sentry-android:8.7.0')
16+
```
17+
```xml {tabTitle:Maven}{filename:pom.xml}
18+
<dependencyManagement>
19+
<dependencies>
20+
<dependency>
21+
<groupId>io.sentry</groupId>
22+
<artifactId>sentry</artifactId>
23+
<version>8.6.0</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.sentry</groupId>
27+
<artifactId>sentry-android</artifactId>
28+
<version>8.7.0</version>
29+
</dependency>
30+
</dependencies>
31+
</dependencyManagement>
32+
```
33+
34+
## Build Plugin And Explicit Dependency
35+
36+
When using our Gradle or Maven plugin and manually defining additional Sentry Android SDK dependencies, it is also possible to end up with mixed versions. The following snippet shows the plugin being configured to use version `8.0.0` but there is an additional dependency that has been set to version `8.1.0`. To fix the issue, set the same version or <PlatformLink to="/configuration/bill-of-materials/">use `sentry-bom`</PlatformLink>.
37+
38+
```groovy {tabTitle:Gradle}{filename:build.gradle}
39+
plugins { id "io.sentry.android.gradle" version "5.3.0" }
40+
41+
dependencies {
42+
implementation 'io.sentry:sentry-okhttp:8.1.0'
43+
}
44+
45+
sentry {
46+
autoInstallation {
47+
sentryVersion = "8.0.0"
48+
}
49+
}
50+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: Troubleshooting
3+
description: "Troubleshoot and resolve common issues with the Java SDK."
4+
sidebar_order: 9000
5+
---
6+
7+
<PageGrid />
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Mixed Versions
3+
description: "Troubleshoot and resolve mixed Java SDK dependency versions."
4+
sidebar_order: 1000
5+
---
6+
7+
Using multiple Java SDK dependencies with mixed versions is not supported as it is very likely to lead to a crash later on. For this reason we chose to crash the application on SDK init instead.
8+
9+
## Multiple Dependencies With Mixed Versions
10+
11+
The following snippet shows a mixed version conflict caused by using `sentry` with version `8.6.0` and `sentry-logback` with version `8.7.0`. To fix the issue please set the same version for all dependencies or <PlatformLink to="/configuration/bill-of-materials/">use `sentry-bom`</PlatformLink>. This may also happen if you are using an internal library which has a different version defined.
12+
13+
```groovy {tabTitle:Gradle}{filename:build.gradle}
14+
implementation('io.sentry:sentry:8.6.0')
15+
implementation('io.sentry:sentry-logback:8.7.0')
16+
```
17+
```xml {tabTitle:Maven}{filename:pom.xml}
18+
<dependencyManagement>
19+
<dependencies>
20+
<dependency>
21+
<groupId>io.sentry</groupId>
22+
<artifactId>sentry</artifactId>
23+
<version>8.6.0</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>io.sentry</groupId>
27+
<artifactId>sentry-logback</artifactId>
28+
<version>8.7.0</version>
29+
</dependency>
30+
</dependencies>
31+
</dependencyManagement>
32+
```
33+
34+
## Build Plugin And Explicit Dependency
35+
36+
When using our Gradle or Maven plugin and manually defining additional Sentry Java SDK dependencies, it is also possible to end up with mixed versions. The following snippet shows the plugin being configured to use version `8.0.0`, but there is an additional dependency that has been set to version `8.1.0`. To fix the issue, set the same version or <PlatformLink to="/configuration/bill-of-materials/">use `sentry-bom`</PlatformLink>.
37+
38+
```groovy {tabTitle:Gradle}{filename:build.gradle}
39+
plugins { id "io.sentry.android.gradle" version "5.3.0" }
40+
41+
dependencies {
42+
implementation 'io.sentry:sentry-opentelemetry-agentless-spring:8.1.0'
43+
}
44+
45+
sentry {
46+
autoInstallation {
47+
sentryVersion = "8.0.0"
48+
}
49+
}
50+
```
51+
52+
## Agent Version And Build Time Version
53+
54+
When using `sentry-opentelemetry-agent` you may end up using a version of the Agent that differs from other Sentry Java SDK dependencies you are using. This is also not supported. Use the same version for `sentry-opentelemetry-agent` and all other Java SDK dependencies.

0 commit comments

Comments
 (0)