From d4b5a796fa0340cd7af499a8ecd79eaf4fc83946 Mon Sep 17 00:00:00 2001 From: Karl Heinz Struggl Date: Mon, 26 Aug 2024 17:01:07 +0200 Subject: [PATCH 1/2] adds troubleshooting entry about Sentry.init --- docs/platforms/android/troubleshooting/index.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/platforms/android/troubleshooting/index.mdx b/docs/platforms/android/troubleshooting/index.mdx index d33435f660d4b..662716a2c1e22 100644 --- a/docs/platforms/android/troubleshooting/index.mdx +++ b/docs/platforms/android/troubleshooting/index.mdx @@ -4,6 +4,16 @@ description: "Troubleshoot and resolve common issues with the Android SDK." sidebar_order: 9000 --- +## Obfuscated stack traces, missing Android-specific context + +If stack traces don't get unobfuscated properly, even though mapping files are uploaded correctly, or if Android context information is missing from events, a possible reason is that the SDK is initialized with `Sentry.init` instead of `SentryAndroid.init`. + + +For manual initialization on Android, always use `SentryAndroid.init`. + + +From SDK version `8.0.0` on, using `Sentry.init` on Android will cause a compile-time exception. + ## Excluding Unwanted Resources from APK/AAB The Sentry Android SDK bundles some resources transitively from the Sentry Java SDK that are not required for Android apps. It's not possible to exclude these resources when publishing the SDK, but you can add the following snippet to your `app/build.gradle` file to reduce the final APK size by a bit: From 1fab77127c2d8596c90cc9d6f512f7bd95e48da2 Mon Sep 17 00:00:00 2001 From: Karl Heinz Struggl Date: Tue, 27 Aug 2024 05:10:23 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Markus Hintersteiner --- docs/platforms/android/troubleshooting/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/android/troubleshooting/index.mdx b/docs/platforms/android/troubleshooting/index.mdx index 662716a2c1e22..d20413e62ff4a 100644 --- a/docs/platforms/android/troubleshooting/index.mdx +++ b/docs/platforms/android/troubleshooting/index.mdx @@ -6,13 +6,13 @@ sidebar_order: 9000 ## Obfuscated stack traces, missing Android-specific context -If stack traces don't get unobfuscated properly, even though mapping files are uploaded correctly, or if Android context information is missing from events, a possible reason is that the SDK is initialized with `Sentry.init` instead of `SentryAndroid.init`. +If stack traces don't get deobfuscated properly, even though mapping files are uploaded correctly, or if Android context information is missing from events, a possible reason is that the SDK is initialized with `Sentry.init` instead of `SentryAndroid.init`. For manual initialization on Android, always use `SentryAndroid.init`. -From SDK version `8.0.0` on, using `Sentry.init` on Android will cause a compile-time exception. +From SDK version `8.0.0` on, using `Sentry.init` on Android will throw an `IllegalArgumentException`. ## Excluding Unwanted Resources from APK/AAB