I can see following crashes in the app. I got the ...
# koin
k
I can see following crashes in the app. I got the code from the official Koin samples repo. any ideas? Error:
Fatal Exception: java.lang.IllegalStateException
Koin context has not been initialized in rememberKoinApplication
Code:
import android.app.Application
class MainApplication : Application() {
override fun onCreate() {
super.onCreate()
instance = this
}
companion object {
var instance : Application? = null
}
}
I suspect the app is in background when this crash occurs. It is happening on One Plus device only though.
k
Yes, it's there. This issue is happening probably when the app is in background and not all the time. I suspect it is something to do with this way of providing application context. IS there any better way to do this?
Copy code
override fun onCreate() {
    super.onCreate()
    instance = this
}

companion object {
    var instance : Application? = null
}
a
I'm working on something better to help for such case
🙏 1
k
Looking forward. To it
👍 1