Arnaud Schildknecht
08/06/2026, 8:01 AMe: file:///Users/.../repositories/myRepo/sharedKit/build/SwiftExport/iosSimulatorArm64/Debug/files/IoInsertKoinKoinCore/IoInsertKoinKoinCore.kt:1109:76 API marked as @KoinInternalAPI and is intended for internal framework use only. It may change or be removed in future releases without notice. External usage is strongly discouraged.
I tried the DSL and the annotation. I also tried to add the following compiler option optIn.add("org.koin.core.annotation.KoinInternalApi"), but I always get the same result and I don't understand what's going on and why. As soon as I make a module's declaration public, I get the error.
I'm using Kotlin 2.4.10 and Koin 4.2.2. FYI, I didn't have this problem with the Obj-C export. I can't provide an example right now, but I'll try to put something together if required.
Is there a particular way to setup Koin with SwiftExport? Is there any known limitations or even incompatibilty?tou
08/08/2026, 5:29 AMArnaud Schildknecht
08/10/2026, 7:16 AMloadKoinModules .
startKoin {
AuthenticationDomainModule.load()
GreetingDomainModule.load()
}
object AuthenticationDomainModule {
fun load() {
loadKoinModules(domainModule)
}
}
internal val domainModule = module {
includes(dataModule)
factory { AuthenticationUseCaseImpl(get()) }
}arnaud.giuliani
08/20/2026, 3:17 PMArnaud Schildknecht
08/21/2026, 9:25 AMclass KoinDependencies: KoinComponent {
val authenticationUseCaseImpl: AuthenticationUseCaseImpl by inject()
val greetingUseCaseImpl: GreetingUseCaseImpl by inject()
}
Each module is declaring whats available :
val greetingDomainModule = module {
includes(dataModule)
factory { GreetingUseCaseImpl(get()) }
}
Then I had a free function to init koin:
internal val allModules = buildList {
addAll(greetingDomainModule)
}
fun initKoin() {
startKoin {
modules(allModules)
}
}
But I replaced that with an object
// Inside each module
object GreetingDomainModule {
fun load() {
loadKoinModules(greetingDomainModule)
}
}
internal val greetingDomainModule = module {
includes(dataModule)
factory { GreetingUseCaseImpl(get()) }
}
// Shared initialisation
object iOSInjection {
fun initKoin() {
startKoin {
GreetingDomainModule.load()
}
}
fun greetingUseCase(): GreetingUseCaseImpl = getKoin().get()
}
Not sure it answers your question well, but let me know 🙂