hi, I’m new to koin, this is my first attempt to s...
# koin
o
hi, I’m new to koin, this is my first attempt to set it up. but it does not work. my dependencies are wery simple:
Copy code
class PWApp: Application() {

    private val appModule = module {
        single<AuthRepository> { SecureAuthRepository(get()) }
    }

    override fun onCreate() {
        super.onCreate()
        Stetho.initializeWithDefaults(this)
        startKoin(this, listOf(appModule))
    }
}
but it can not resolve reference for
join()
. Android Studio does not suggest any imports so I looked up examples and copy/pasted imporr from there:
import org.koin.android.ext.android.inject
But this method does not suits my case:
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public inline fun <reified T : Any> ComponentCallbacks.inject(name: String = ..., scope: Scope? = ..., noinline parameters: ParameterDefinition /* = () -> ParameterList */ = ...): Lazy<AuthRepository> defined in org.koin.android.ext.android
I have no idea what to try next. Could someone please help me with this ?
t
are you trying to inject in some custom class?
o
yup, just figured out that it works in activity…. how do I inject in non-android classes ?
seems I figured it out. added
: KoinComponent
👍 1
thanks @tapchicoma for your help