Skip to content

Commit 7410eb5

Browse files
committed
Troubleshooting Guide for mixed versions in Java / Android SDK
1 parent f696627 commit 7410eb5

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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 this leads 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 mix of version caused by using `sentry` with version `8.6.0` and `sentry-android` with version `8.7.0`. To fix the issue please set the same version for all dependencies or use `sentry-bom`. 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 also an additional dependency that has been set to version `8.1.0`. To fix the issue please set the same version or use `sentry-bom`.
37+
38+
```groovy {tabTitle:Gradle}{filename:build.gradle}
39+
dependencies {
40+
implementation 'io.sentry:sentry-okhttp:8.1.0'
41+
}
42+
43+
sentry {
44+
autoInstallation {
45+
sentryVersion = "8.0.0"
46+
}
47+
}
48+
```
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: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 this leads 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 mix of version 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 also an additional dependency that has been set to version `8.1.0`. To fix the issue please set the same version or <PlatformLink to="/configuration/bill-of-materials/">use `sentry-bom`</PlatformLink>.
37+
38+
```groovy {tabTitle:Gradle}{filename:build.gradle}
39+
dependencies {
40+
implementation 'io.sentry:sentry-opentelemetry-agentless-spring:8.1.0'
41+
}
42+
43+
sentry {
44+
autoInstallation {
45+
sentryVersion = "8.0.0"
46+
}
47+
}
48+
```
49+
50+
## Agent Version And Build Time Version
51+
52+
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 as dependencies. This is also not supported. Please use the same version for `sentry-opentelemetry-agent` and all other Java SDK dependencies.

0 commit comments

Comments
 (0)