is there any way to debug NoDefinitionFoundExcepti...
# koin
j
is there any way to debug NoDefinitionFoundException? I have a shared module which registers a singleton, Android resolves it just fine at runtime. on iOS, even though I startKoin and load the module which has this
single<IErrorService> { ErrorService() }
, I get 'No definition found for type IErrorService'. Need a way to print out what is in the koin registry somehow or any other insight. When I look at the koin instance in memory I can't see anything in the _instances container or anything else. Koin is initialized before I even try to resolve the instance also. This is what I call from iOS to resolve the instance, I've only run into this issue on a new project, the first project I did same code it worked fine. Its like non of the modules are loaded in Koin as I can't resolve any type anymore.
Copy code
public fun <T> koinGet(
    clazz: KClass<*>,
    qualifier: Qualifier? = null,
    parameters: ParametersDefinition? = null
): T {
    val koin = KoinPlatformTools.defaultContext().get()
    return koin.get(clazz, qualifier, parameters)
}
c
You can enable logging in koin to get more information on what is being resolved.
Copy code
KoinApplication(
        application = {
            // Log Koin to stdout
            logger(PrintLogger(
                level = Level.DEBUG,
            ))
            // Load modules
            modules(moduleList)
        }
    ) {
        content()
    }