Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed log requests before Statsig is initialized cause a crash #8

Open
caraesten opened this issue Mar 15, 2023 · 0 comments
Open

Comments

@caraesten
Copy link
Contributor

Stack trace:

Fatal Exception: androidx.datastore.preferences.protobuf.n1: lateinit property sharedPrefs has not been initialized
       at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(BuildersKt__Builders_commonKt.java:169)
       at kotlinx.coroutines.BuildersKt.withContext(BuildersKt.java:1)
       at com.statsig.androidsdk.StatsigNetworkImpl.addFailedLogRequest(StatsigNetwork.kt:149)
       at com.statsig.androidsdk.StatsigNetworkImpl.access$getDispatcherProvider$p(StatsigNetwork.kt:69)
       at com.statsig.androidsdk.StatsigNetworkImpl$postRequest$2.invokeSuspend(StatsigNetworkImpl.java:220)
       at com.statsig.androidsdk.StatsigNetworkImpl$apiPostLogs$$inlined$postRequest$1.invokeSuspend(StatsigNetwork.kt:220)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
       at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:2)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:570)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Could have been introduced here when moving setup off the main dispatcher and onto io?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant