Troubleshooting
NDK
If you're using a version of sentry-android
before 5.0, due to current limitations in how sentry-native
works, it cannot identify native libraries loaded directly from .apk
files. Instead, it needs to have access to the extracted libraries on the file system.
This functionality is disabled by default
when using an Android Gradle Plugin >= v3.6.0, and it needs to be enabled with the
extractNativeLibs
configuration option.
If you're using Android App Bundle, set android.bundle.enableUncompressedNativeLibs=false
along with the extractNativeLibs
configuration option.
In addition, sentry-native
uses tagged pointers
internally. As a result, the Android SDK won't work out of the box on devices with a newer Android OS because they have their own conflicting pointer tagging.
If you're using a version of sentry-android
before 3.1, you must manually disable the allowNativeHeapPointerTagging
configuration option because sentry-native
uses tagged pointers
internally. As a result, this option won't work out of the box on devices with a newer Android OS because they have their own conflicting pointer tagging. This is fixed in sentry-android
versions 3.1 and above.
Example AndroidManifest.xml:
AndroidManifest.xml
<application
android:allowNativeHeapPointerTagging="false"
android:extractNativeLibs="true">
</application>
Example gradle.properties:
gradle.properties
android.bundle.enableUncompressedNativeLibs=false
Sentry Android Gradle Plugin Build Issues
The Sentry Android Gradle plugin uses bytecode manipulation to automatically measure the performance of your application. This process requires looking at the dependencies of the application, which can potentially break the build process if there are libraries which have been compiled/minified with a non-default java compiler, like R8/D8.
The culprit is usually our File I/O instrumentation, which can be disabled as follows:
import io.sentry.android.gradle.InstrumentationFeature
sentry {
tracingInstrumentation {
enabled = true
features = EnumSet.allOf(InstrumentationFeature) - InstrumentationFeature.FILE_IO
}
}
If disabling the file I/O instrumentation feature doesn't help, you can also disable the entire bytecode manipulation logic through the tracingInstrumentation.enabled
flag:
sentry {
tracingInstrumentation {
enabled = false
}
}
Please consider reporting these issues on GitHub, so we can keep track of them.
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
- Package:
- maven:io.sentry:sentry-android
- Version:
- 5.7.4
- Repository:
- https://github.com/getsentry/sentry-java