Fix Android ViewModel Scope Leaked via Retained Fragment
ViewModel instances leak memory when retained fragments hold references to destroyed Activity contexts or views.
Open guideCategory archive
Published troubleshooting guides for kotlin issues.
41 guides available
ViewModel instances leak memory when retained fragments hold references to destroyed Activity contexts or views.
Open guideJetpack Compose enters an infinite recomposition loop when a state change during composition triggers another recomposition, freezing the UI.
Open guideDispatchers.IO thread pool is exhausted when too many coroutines perform blocking I/O, causing new coroutines to wait indefinitely.
Open guidekotlinx.serialization fails to deserialize polymorphic JSON when the class discriminator is missing or does not match registered subclasses.
Open guideKoin throws StackOverflowError when two or more dependencies form a circular reference, preventing application startup.
Open guideCoroutines launched with lifecycleScope are cancelled on configuration change, losing in-flight network requests and user progress.
Open guideOkHttp connection pool runs out of available connections when response bodies are not closed, causing requests to hang indefinitely.
Open guideMoshi throws JsonDataException when a required non-null property is missing from the JSON response, failing deserialization entirely.
Open guideGson throws StackOverflowError when serializing objects with circular references, causing app crashes during JSON conversion.
Open guideRoom database migration fails when the schema version does not match the expected version or the migration path is incomplete.
Open guideKotlin SharedFlow collectors miss emissions because the flow has no replay value or the collector starts after the emission occurred.
Open guideGradle build daemon is killed by the OS out-of-memory killer during large builds, causing abrupt build failures with no Java stack trace.
Open guideRetrofit returns null response body on successful HTTP requests when the server returns empty body or mismatched content type.
Open guideAccessing a lateinit var before initialization throws UninitializedPropertyAccessException, a common Kotlin runtime error in Android development.
Open guideCatching Exception in a coroutine swallows CancellationException, preventing proper coroutine cancellation and causing resource leaks.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideDeep dive into Kotlin issue resolution with production-tested solutions.
Open guideHandle cancellation properly with isActive checks and non-cancellable blocks.
Open guideFix null safety issues with Java interop and platform type handling.
Open guide