You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I started seeing an early crash (<=1s after app start) after adding a new feature to my app that allows to replace database from backup, I'm using SQLDelight and it's initialization fails because application instance I'm getting from Koin is null. It's a rare crash that happens on various android versions (8-13) according to firebase.
There are 2 entry points in my app, an activity and workmanager's worker, in some crashes I can see activity in main thread. Koin is properly started in the application's onCreate. The component where crash happens is created at start because of its dependent components and it initializes database from it's constructor by starting a coroutine on Displatchers.IO where application is used
Is it possible that app can't get initialized and stays null due to some issue elsewhere?
Fatal Exception: java.lang.NullPointerException: Parameter specified as non-null is null: method app.cash.sqldelight.driver.android.AndroidSqliteDriver.<init>, parameter context
at app.cash.sqldelight.driver.android.AndroidSqliteDriver.<init>(AndroidSqliteDriver.java:3)
at app.cash.sqldelight.driver.android.AndroidSqliteDriver.<init>(AndroidSqliteDriver.java:3)
at ua.syt0r.kanji.core.user_data.UserDataDatabaseManagerAndroid.createDatabaseConnection(UserDataDatabaseManagerAndroid.java:60)
at ua.syt0r.kanji.core.user_data.BaseUserDataDatabaseManager$1.invokeSuspend(BaseUserDataDatabaseManager.java:34)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:8)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:109)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.java:15)
at kotlinx.coroutines.scheduling.TaskImpl.run(TaskImpl.java:2)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:93)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:93)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:93)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java:93)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm using koin 3.2.0 in a multiplatform project
Recently I started seeing an early crash (<=1s after app start) after adding a new feature to my app that allows to replace database from backup, I'm using SQLDelight and it's initialization fails because application instance I'm getting from Koin is null. It's a rare crash that happens on various android versions (8-13) according to firebase.
There are 2 entry points in my app, an activity and workmanager's worker, in some crashes I can see activity in main thread. Koin is properly started in the application's onCreate. The component where crash happens is created at start because of its dependent components and it initializes database from it's constructor by starting a coroutine on Displatchers.IO where application is used
Is it possible that app can't get initialized and stays null due to some issue elsewhere?
Module
Crash place
Application
Stacktrace:
Beta Was this translation helpful? Give feedback.
All reactions