I don't know if this is the correct channel for th...
# android
e
I don't know if this is the correct channel for this question, so forgive me if it is not the correct place. I want to add dependency:
androidx.lifecycle:lifecycle-runtime-ktx:$androidLifecycle
in a library project If I add this dependency in an Android library project there is no problem, but if I add this dependency in a normal kotlin library the extension functions cannot be found. This import statement stops working:
import androidx.lifecycle.lifecycleScope
But this doesn't:
import androidx.lifecycle.LifecycleOwner
I am creating a library that have a dependency on the androidx lifecycle but I don't need resources or access to any normal
android.*
dependency, that's why I'm trying to use a normal kotlin library instead of an android library Any idea on why this is happening?
v
You’re trying to import an android dependency into a non-android project
2
e
but
androidx.lifecycle:lifecycle-runtime-ktx
doesn't have direct dependencies on android. And it doesn't explain that for example
LifecycleOwner
is available but an extension on it isn't