Hey guys, I am using koin compose in my project. I...
# koin
v
Hey guys, I am using koin compose in my project. I see the example of sample-compose from koin repository. I am getting weird issue on
viewModelOf
Copy code
package com.vivek.sportsresult.di

import org.koin.androidx.viewmodel.dsl.viewModelOf
import org.koin.dsl.module

val appModule = module {
    viewModelOf(::MainActivityViewModel)
}
Can someone how can I fix this error.
Error is too big so I am adding small description
None of the following functions can be called with the arguments supplied.
MainActivityViewModel.kt
Copy code
package com.vivek.sportsresult.viewmodel

import androidx.lifecycle.ViewModel

class MainActivityViewModel : ViewModel() {
}
Copy code
implementation "io.insert-koin:koin-android:$koin_version"

implementation "io.insert-koin:koin-androidx-compose:$koin_version"
koin 3.2.0
a
be sure to use the right import from
org.koin.androidx.viewmodel.dsl
v
I used this import
Copy code
import org.koin.androidx.viewmodel.dsl.viewModelOf
import org.koin.dsl.module
but still have problem
a
can you just add
()
as empty constructor? 🤔
v
Now I am getting this error on
()
😭
This syntax is reserved for future use; to call a reference, enclose it in parentheses: (foo::bar)(args)
I added my project in github https://github.com/vivek-modi/SportsResult
Never mind I fix the issue
a
ok 👍
👍 2
m
what causing it? @Vivek Modi
v
I didn't import it my viewmodel
🙏 1