amplitude/Amplitude-Kotlin

Crash in Android with Amplitude SDK: VM already shutting down

Opened this issue · 0 comments

Summary

We are encountering a crash in our Android project that appears to be caused by the Amplitude SDK, specifically when initializing the event pipeline. The crash log shows the following error:

Fatal Exception: java.lang.IllegalStateException: VM already shutting down
at java.lang.Runtime.addShutdownHook(Runtime.java:280)
at com.amplitude.core.platform.EventPipeline.registerShutdownHook(EventPipeline.kt:178)
at com.amplitude.core.platform.EventPipeline.<init>(EventPipeline.kt:59)

The crash is reported by our users, but we haven't been able to reproduce it on our devices during development. It seems to occur consistently for users when the app shuts down. We are using the following implementation:

implementation 'com.amplitude:analytics-android:1.+'