From 7410eb52d0d82b9c89b9be74a735cfc17fcbd29a Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 27 Mar 2025 09:29:45 +0100 Subject: [PATCH 1/5] Troubleshooting Guide for mixed versions in Java / Android SDK --- .../android/troubleshooting/index.mdx | 2 + .../troubleshooting/mixed-versions/index.mdx | 48 +++++++++++++++++ .../java/common/troubleshooting/index.mdx | 7 +++ .../troubleshooting/mixed-versions/index.mdx | 52 +++++++++++++++++++ 4 files changed, 109 insertions(+) create mode 100644 docs/platforms/android/troubleshooting/mixed-versions/index.mdx create mode 100644 docs/platforms/java/common/troubleshooting/index.mdx create mode 100644 docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx diff --git a/docs/platforms/android/troubleshooting/index.mdx b/docs/platforms/android/troubleshooting/index.mdx index 673b94205faa9..aa5ecfa426396 100644 --- a/docs/platforms/android/troubleshooting/index.mdx +++ b/docs/platforms/android/troubleshooting/index.mdx @@ -318,3 +318,5 @@ This problem is only relevant to these specific versions: `sentry-android-core` Check [this issue](https://github.com/getsentry/sentry-android-gradle-plugin/issues/329) for more details. + + diff --git a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx new file mode 100644 index 0000000000000..2a16534ad6585 --- /dev/null +++ b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx @@ -0,0 +1,48 @@ +--- +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 this leads 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 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. + +```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} + + + + io.sentry + sentry + 8.6.0 + + + io.sentry + sentry-android + 8.7.0 + + + +``` + +## 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 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`. + +```groovy {tabTitle:Gradle}{filename:build.gradle} +dependencies { + implementation 'io.sentry:sentry-okhttp:8.1.0' +} + +sentry { + autoInstallation { + sentryVersion = "8.0.0" + } +} +``` diff --git a/docs/platforms/java/common/troubleshooting/index.mdx b/docs/platforms/java/common/troubleshooting/index.mdx new file mode 100644 index 0000000000000..6c1118c354fbe --- /dev/null +++ b/docs/platforms/java/common/troubleshooting/index.mdx @@ -0,0 +1,7 @@ +--- +title: Troubleshooting +description: "Troubleshoot and resolve common issues with the Java SDK." +sidebar_order: 9000 +--- + + diff --git a/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx new file mode 100644 index 0000000000000..42cbc1a6d5c01 --- /dev/null +++ b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx @@ -0,0 +1,52 @@ +--- +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 this leads 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 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 use `sentry-bom`. 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} + + + + io.sentry + sentry + 8.6.0 + + + io.sentry + sentry-logback + 8.7.0 + + + +``` + +## 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 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`. + +```groovy {tabTitle:Gradle}{filename:build.gradle} +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 as dependencies. This is also not supported. Please use the same version for `sentry-opentelemetry-agent` and all other Java SDK dependencies. From f300e6016843c7537e9190b50fd0e2db668c2aff Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Fri, 28 Mar 2025 06:19:57 +0100 Subject: [PATCH 2/5] Update docs/platforms/android/troubleshooting/mixed-versions/index.mdx --- docs/platforms/android/troubleshooting/mixed-versions/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx index 2a16534ad6585..9a09a6f1d5c42 100644 --- a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx +++ b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx @@ -36,6 +36,8 @@ implementation('io.sentry:sentry-android:8.7.0') 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`. ```groovy {tabTitle:Gradle}{filename:build.gradle} +plugins { id "io.sentry.android.gradle" version "5.3.0" } + dependencies { implementation 'io.sentry:sentry-okhttp:8.1.0' } From 854396af90ab4e5ac56050812f491e401a54af73 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Fri, 28 Mar 2025 06:20:59 +0100 Subject: [PATCH 3/5] Update docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx --- .../java/common/troubleshooting/mixed-versions/index.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx index 42cbc1a6d5c01..4a7c6e36ed2c8 100644 --- a/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx +++ b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx @@ -36,6 +36,8 @@ implementation('io.sentry:sentry-logback:8.7.0') 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 use `sentry-bom`. ```groovy {tabTitle:Gradle}{filename:build.gradle} +plugins { id "io.sentry.android.gradle" version "5.3.0" } + dependencies { implementation 'io.sentry:sentry-opentelemetry-agentless-spring:8.1.0' } From e9adbfc8da95833b9524a907c1c15e667671efd5 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Fri, 28 Mar 2025 06:36:11 +0100 Subject: [PATCH 4/5] link BOM docs --- .../android/troubleshooting/mixed-versions/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx index 9a09a6f1d5c42..4743a8dc8cf49 100644 --- a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx +++ b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx @@ -8,7 +8,7 @@ Using multiple Android SDK dependencies with mixed versions is not supported as ## Multiple Dependencies With Mixed Versions -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. +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. ```groovy {tabTitle:Gradle}{filename:build.gradle} implementation('io.sentry:sentry:8.6.0') @@ -33,7 +33,7 @@ implementation('io.sentry:sentry-android:8.7.0') ## 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 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`. +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`. ```groovy {tabTitle:Gradle}{filename:build.gradle} plugins { id "io.sentry.android.gradle" version "5.3.0" } From 28e372a9979d8c4a875417d9dcf916543dd8643d Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 31 Mar 2025 06:30:11 +0200 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Alex Krawiec --- .../android/troubleshooting/mixed-versions/index.mdx | 6 +++--- .../java/common/troubleshooting/mixed-versions/index.mdx | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx index 4743a8dc8cf49..cccb5db31cc41 100644 --- a/docs/platforms/android/troubleshooting/mixed-versions/index.mdx +++ b/docs/platforms/android/troubleshooting/mixed-versions/index.mdx @@ -4,11 +4,11 @@ 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 this leads to a crash later on. For this reason we chose to crash the application on SDK init instead. +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 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. +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 use `sentry-bom`. 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') @@ -33,7 +33,7 @@ implementation('io.sentry:sentry-android:8.7.0') ## 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 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`. +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 use `sentry-bom`. ```groovy {tabTitle:Gradle}{filename:build.gradle} plugins { id "io.sentry.android.gradle" version "5.3.0" } diff --git a/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx index 4a7c6e36ed2c8..dcbf16cdcad40 100644 --- a/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx +++ b/docs/platforms/java/common/troubleshooting/mixed-versions/index.mdx @@ -4,11 +4,11 @@ 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 this leads to a crash later on. For this reason we chose to crash the application on SDK init instead. +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 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 use `sentry-bom`. This may also happen if you are using an internal library which has a different version defined. +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 use `sentry-bom`. 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') @@ -33,7 +33,7 @@ implementation('io.sentry:sentry-logback:8.7.0') ## 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 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`. +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 use `sentry-bom`. ```groovy {tabTitle:Gradle}{filename:build.gradle} plugins { id "io.sentry.android.gradle" version "5.3.0" } @@ -51,4 +51,4 @@ sentry { ## 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 as dependencies. This is also not supported. Please use the same version for `sentry-opentelemetry-agent` and all other Java SDK dependencies. +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.