In addition, has anyone also tried to use Hilt from Android in a kmm project? Wondering how it can be integrated, maybe in full for DI across the project or at least the Android part/modules of the project. Thank you.
m
Mitchell Syer
08/21/2022, 3:00 AM
Hilt is a Android only library, it can probably be used for the android source-set, but not for any other platforms. You should use a KMM DI like Kotlin-Inject for multiplatform projects
You can use the service locator pattern without needing a separate library. It's simple and easy to setup. Good's recommended architecture example uses it.