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.

Example AndroidManifest.xml:

AndroidManifest.xml
Copied
<application
    android:allowNativeHeapPointerTagging="false"
    android:extractNativeLibs="true">
</application>

Example gradle.properties:

gradle.properties
Copied
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:

Copied
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:

Copied
sentry {
  tracingInstrumentation {
    enabled = false
  }
}

Please consider reporting these issues on GitHub, so we can keep track of them.

Help improve this content
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").