Skip to content

Commit

Permalink
chore(Android): Add troubleshooting entry about Sentry.init (#11147)
Browse files Browse the repository at this point in the history
* adds troubleshooting entry about Sentry.init

* Apply suggestions from code review

Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>

---------

Co-authored-by: Markus Hintersteiner <markus.hintersteiner@sentry.io>
  • Loading branch information
2 people authored and Zylphrex committed Sep 4, 2024
1 parent 1eaba4d commit 74acb9c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/platforms/android/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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 deobfuscated properly, even though <PlatformLink to="/enhance-errors/proguard/">mapping files are uploaded correctly</PlatformLink>, 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`.

<Alert level="warning">
For manual initialization on Android, <PlatformLink to="/configuration/manual-init/#manual-initialization">always use `SentryAndroid.init`</PlatformLink>.
</Alert>

From SDK version `8.0.0` on, using `Sentry.init` on Android will throw an `IllegalArgumentException`.

## 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:
Expand Down

0 comments on commit 74acb9c

Please sign in to comment.