Does anyone has a working example of an expect/actual module declaration with annotations that actually work?
I've tried following an official example (
) but i keep getting the same error saying the android module is not implemented (it's empty with a TODO inside).
Sometimes it also says that i have no actual implementation for JVM (i don't have a jvm target) but i don't know how to reproduce this one, and switch back to the other error. I feel like i have exactly the same code between the two errors, i just try and retry, clean and build again and again. Create module files again and again.
In my shared module, i had something like that :
Copy code
//commonMain
LocationModule.kt
@Module
expect class LocationModule
//androidMain
LocationModule.android.kt
@Module
@ComponentScan("com.truc.app.location")
actual class LocationModule
// Same thing for iosMain
And i call these modules in startKoin { modules(...) } in MyApplication.
I feel like i spent 15-20 hours on this so i'm giving up for now and using explicit declaration.
Thierry Kh
12/26/2025, 8:46 PM
Out of curiosity, i installed Koin plugin on AS.
Idk if it's due to the plugin itself of what's happening with Koin in my project, but notice how LocationProvider.android.kt lists LocationProvider.ios.kt instead of LocationProvider.android.kt.
Idk if it's related.