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
Fatal Exception: java.lang.IllegalStateException: There are multiple DataStores active for the same file: /data/user/0/....preferences_pb. You should either maintain your DataStore as a singleton or confirm that there is no two DataStore's active on the same file (by confirming that the scope is cancelled).
at androidx.datastore.core.okio.OkioStorage.createConnection(OkioStorage.java:65)
at androidx.datastore.core.DataStoreImpl$storageConnectionDelegate$1.invoke(DataStoreImpl.java:189)
at androidx.datastore.core.DataStoreImpl$storageConnectionDelegate$1.invoke(DataStoreImpl.java:188)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
at androidx.datastore.core.DataStoreImpl.getStorageConnection$datastore_core_release(DataStoreImpl.java:191)
at androidx.datastore.core.DataStoreImpl$coordinator$2.invoke(DataStoreImpl.kt:192)
at androidx.datastore.core.DataStoreImpl$coordinator$2.invoke(DataStoreImpl.kt:192)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:83)
But I have this code
@Scope
@Target(CLASS, FUNCTION, PROPERTY_GETTER)
annotation class ApplicationSingleton
@ApplicationSingleton
interface SharedComponent : DBModule, NetworkModule, ViewModelsFactoriesModule
@ApplicationSingleton
@Component
abstract class AndroidAppComponent(
private val applicationContext: Context
) : SharedComponent {
@ApplicationSingleton
@Provides
fun provideMyStore(context: Context): MyStore{
return MyStore.createDataStore { context.filesDir.resolve("datastore").resolve(MyStore.PREFERENCES_NAME_KMP).absolutePath }
}
}
Application class and then use it in Activity class like that
interface ApplicationComponentProvider {
val component: AndroidAppComponent
}
val Context.applicationComponent get() = (applicationContext as ApplicationComponentProvider).component
Hi. In my Crashlytics I see this errors:
But I have this code
And in generated code I see
But still get error for some users. What could it be? How it can be improved?
The text was updated successfully, but these errors were encountered: