Michal Klimczak
11/25/2025, 4:54 PMkotlin = "2.1.10"
ksp = "2.1.10-1.0.31" //tried ksp2 as well
koin = "4.1.1"
koinAnnotations = "2.2.0"
More details in 🧵 as not to spam here too muchMichal Klimczak
11/25/2025, 4:55 PMCaused by: org.koin.core.error.NoDefinitionFoundException: No definition found for type 'com.example.android.presentation.main.MainViewModel). Check your Modules configuration and add missing type and/or qualifier!). I tried both legacy and new viewmodels via appropriate ksp flag (noticed that 1.x generated the legacy viewmodels).
The imports and @KoinViewModel annotation are the same for generated and non-generated viewmodels. It doesn't matter if I generate a viewmodel with dependencies or not (removed them to be sure it's not the issue). The visibility of those viewmodels doesn't seem to matter (internal or public), their dependencies too (even copied dependencies of the working one to non-working one) or even if they are placed in the same package.Michal Klimczak
11/25/2025, 4:57 PMpackage com.example.android.presentation.auth.incomplete
...
import org.koin.android.annotation.KoinViewModel
@KoinViewModel
internal class IncompleteUserViewModel(
private val updateAuthUserDataUseCase: UpdateAuthUserDataUseCase,
savedStateHandle: SavedStateHandle,
) : ViewModel() {
Not generated
package com.example.android.presentation.auth.incomplete
...
import org.koin.android.annotation.KoinViewModel
@KoinViewModel
internal class MainViewModel(
private val updateAuthUserDataUseCase: UpdateAuthUserDataUseCase,
savedStateHandle: SavedStateHandle,
) : ViewModel() {Michal Klimczak
11/25/2025, 5:10 PMMichal Klimczak
11/25/2025, 5:13 PMw: [ksp] Generating 'defaultModule' with 22 definitions
w: [ksp] Koin Configuration Generated in 118.316417ms
w: [ksp] [Deprecation] 'defaultModule' generation is deprecated. Use KSP argument arg("KOIN_DEFAULT_MODULE","true") to activate default module generation.
w: [ksp] Koin Configuration Generated in 7.031833ms
w: [ksp] Koin Configuration Check ...
w: [ksp] no module found
w: [ksp] Koin Configuration Check done in 8.295750ms
This no module found is a bit suspiciousMichal Klimczak
11/25/2025, 5:15 PMMichal Klimczak
11/25/2025, 6:00 PMMichal Klimczak
11/25/2025, 7:50 PMmodule is never generated (nor are some of the viewmodels inside default module and it's probably part of the same issue)
@Module
@ComponentScan("com.example.android")
class AndroidModule {
@Factory
fun provideDummy() = Dummy()
}
val androidModule = AndroidModule().module
@Single
class DummyMichal Klimczak
11/26/2025, 9:14 AM