-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Troubleshooting Guide for mixed versions in Java / Android SDK #13140
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7410eb5
Troubleshooting Guide for mixed versions in Java / Android SDK
adinauer f300e60
Update docs/platforms/android/troubleshooting/mixed-versions/index.mdx
adinauer 854396a
Update docs/platforms/java/common/troubleshooting/mixed-versions/inde…
adinauer e9adbfc
link BOM docs
adinauer 28e372a
Apply suggestions from code review
adinauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/platforms/android/troubleshooting/mixed-versions/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Mixed Versions | ||
description: "Troubleshoot and resolve mixed Android SDK dependency versions." | ||
sidebar_order: 1000 | ||
--- | ||
|
||
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. | ||
|
||
## Multiple Dependencies With Mixed Versions | ||
|
||
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. | ||
|
||
```groovy {tabTitle:Gradle}{filename:build.gradle} | ||
implementation('io.sentry:sentry:8.6.0') | ||
implementation('io.sentry:sentry-android:8.7.0') | ||
``` | ||
```xml {tabTitle:Maven}{filename:pom.xml} | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.sentry</groupId> | ||
<artifactId>sentry</artifactId> | ||
<version>8.6.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.sentry</groupId> | ||
<artifactId>sentry-android</artifactId> | ||
<version>8.7.0</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
``` | ||
|
||
## Build Plugin And Explicit Dependency | ||
|
||
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>. | ||
|
||
```groovy {tabTitle:Gradle}{filename:build.gradle} | ||
adinauer marked this conversation as resolved.
Show resolved
Hide resolved
adinauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
plugins { id "io.sentry.android.gradle" version "5.3.0" } | ||
|
||
dependencies { | ||
implementation 'io.sentry:sentry-okhttp:8.1.0' | ||
} | ||
|
||
sentry { | ||
autoInstallation { | ||
sentryVersion = "8.0.0" | ||
} | ||
} | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Troubleshooting | ||
description: "Troubleshoot and resolve common issues with the Java SDK." | ||
sidebar_order: 9000 | ||
--- | ||
|
||
<PageGrid /> |
54 changes: 54 additions & 0 deletions
54
docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: Mixed Versions | ||
description: "Troubleshoot and resolve mixed Java SDK dependency versions." | ||
sidebar_order: 1000 | ||
--- | ||
|
||
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. | ||
|
||
## Multiple Dependencies With Mixed Versions | ||
|
||
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. | ||
|
||
```groovy {tabTitle:Gradle}{filename:build.gradle} | ||
implementation('io.sentry:sentry:8.6.0') | ||
implementation('io.sentry:sentry-logback:8.7.0') | ||
``` | ||
```xml {tabTitle:Maven}{filename:pom.xml} | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>io.sentry</groupId> | ||
<artifactId>sentry</artifactId> | ||
<version>8.6.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.sentry</groupId> | ||
<artifactId>sentry-logback</artifactId> | ||
<version>8.7.0</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
``` | ||
|
||
## Build Plugin And Explicit Dependency | ||
|
||
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>. | ||
|
||
```groovy {tabTitle:Gradle}{filename:build.gradle} | ||
adinauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
plugins { id "io.sentry.android.gradle" version "5.3.0" } | ||
|
||
dependencies { | ||
implementation 'io.sentry:sentry-opentelemetry-agentless-spring:8.1.0' | ||
} | ||
|
||
sentry { | ||
autoInstallation { | ||
sentryVersion = "8.0.0" | ||
} | ||
} | ||
``` | ||
|
||
## Agent Version And Build Time Version | ||
|
||
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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Android it's gonna be buried a bit but that's fine, we link to it in the error message.
Now that I think of it, should we also add this link when reporting the error in the Maven Plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah linking here will probably help customers solve this more quickly.