Pablo
11/26/2024, 11:58 AMKonstantin Tskhovrebov
11/26/2024, 12:08 PMPablo
11/26/2024, 5:37 PMclass JVMPlatform {
val name: String = "Java ${System.getProperty("java.version")}"
}
val appModule = module {
single<JVMPlatform> {JVMPlatform()}
}
I added koin the project following Koin documentation:
@Composable
fun App() {
MaterialTheme {
KoinApplication(application = {
modules(
appModule
)
}) {
KoinContext() {
WelcomeScreen()
}
}
}
}
And when trying to inject the variable of type JVMPlatform I cannot figure out how to do it:
val myVariable: JVMPlatform = get()
That gives this error:
Type mismatch. Required:JVMPlatform Found:Koin
Pablo
11/26/2024, 5:54 PMval greetingDI: Greeting = koinInject<Greeting>()
Pablo
11/26/2024, 5:54 PMPablo
11/26/2024, 5:54 PMKoinApplication has not been started
Pablo
11/26/2024, 5:56 PMKoinContext() {
Pablo
11/26/2024, 6:04 PMKonstantin Tskhovrebov
11/26/2024, 6:09 PMPablo
11/26/2024, 7:16 PM