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
NdkLinkError will be reported to Bugsnag.
If you experience an
UnsatisfiedLinkError we recommend linking Bugsnag’s ANR plugin and/or NDK plugin using the Relinker library to reduce their incidence.
Add the Relinker library using the installation instructions, then load the appropriate Bugsnag plugin with:
Configuration config = Configuration.load(this); config.setPersistenceDirectory(new File("/my-custom-dir")); Bugsnag.start(this, config);
val config = Configuration.load(this) config.persistenceDirectory = File("/my-custom-dir") Bugsnag.start(this, config)
Failing to make the
persistenceDirectory unique will cause undefined behaviour in the storage of error and session reports.
If one of your processes uses an app component that is not an
Activity then you should manually track sessions for that process. This is because automatic session tracking relies on activity lifecycle callbacks.
Because each process uses a separate JVM any custom configuration, such as attaching custom diagnostics, will need to be carried out on each Bugsnag instance.
Bugsnag can capture
StrictMode violations depending on the policy you have set. See Bugsnag’s
StrictMode docs for more information.
Calling Bugsnag static client methods, such as
Bugsnag.addMetadata(), will throw an exception if you have not yet called
We recommend calling
Bugsnag.start() in the main thread as early as possible in your app’s lifecycle in order to catch all errors. Once this method has been invoked, it is safe to use other methods on the Bugsnag client from any thread; a lock will cause the calling thread to wait for startup to complete fully.
In the unusual case where it’s not possible to determine whether or not
Bugsnag.start() has been invoked, you can use
Bugsnag.isStarted() to guard uses of Bugsnag client methods.