Frequently asked questions

Contents

What are AnrLinkError and NdkLinkErrors?

Android’s native library loading can be unreliable on certain OS versions. This can result in UnsatisfiedLinkErrors being thrown when Bugsnag attempts to load the native libraries used for ANR and NDK detection. If this error occurs, ANR or NDK crash detection will be disabled and an AnrLinkError or NdkLinkError will be reported to Bugsnag.

If you experience UnsatisfiedLinkErrors we recommend using the Relinker library to reduce their incidence.

Why do I see StrictMode violations in my dashboard?

If you have enabled StrictMode in your development builds with the penaltyDeath option, then Bugsnag will automatically detect StrictMode exceptions. Any reports for these errors will contain a human readable description of the policy violation (e.g. ActivityLeak) in their metadata.

If you have not already setup StrictMode, you can do so by entering the following code in your Application class. It is strongly recommended that you only enable StrictMode for non-release builds.

if (BuildConfig.DEBUG) {
    StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
               .detectDiskReads()
               .detectDiskWrites()
               .detectNetwork()
               .penaltyDeath()
               .build());

    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
               .detectLeakedSqlLiteObjects()
               .detectLeakedClosableObjects()
               .penaltyDeath()
               .build());
}
if (BuildConfig.DEBUG) {
    StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder()
                .detectDiskReads()
                .detectDiskWrites()
                .detectNetwork()
                .penaltyDeath()
                .build())

    StrictMode.setVmPolicy(StrictMode.VmPolicy.Builder()
            .detectLeakedSqlLiteObjects()
            .detectLeakedClosableObjects()
            .penaltyDeath()
            .build())
}