Can I export a common dependency to android? like ...
# multiplatform
o
Can I export a common dependency to android? like
Copy code
val commonMain by getting {
    dependencies {
        api(Deps.kotlinxDateTime)
    }
}
or maybe
Copy code
val androidMain by getting {
    dependencies {
        api(Deps.kotlinxDateTime)
    }
}
And use kotlinx datetime from android? PS: I tried these but they didn't work.
r
This is enough
Copy code
val commonMain by getting {
    dependencies {
        api(Deps.kotlinxDateTime)
    }
}
and you will see DateTime in Android app module
o
Well I was also sure this would work but it didn't đŸ˜•
I'm pubishing to maven repository and consuming the artifact from android project. Maybe there is something I need to do while publishing
r
that’s strange, I use this artifact
org.jetbrains.kotlinx:kotlinx-datetime
in common as
api
and I can use it in Android
o
I get
Unresolved reference: datetime
Cannot access class 'kotlinx.datetime.Instant'. Check your module classpath for missing or conflicting dependencies
maybe this is a different error đŸ˜•
m
Does it actually build, though? There's a bug that causes this type of problem, it complains but works anyway.
o
no it doesn't build
well, it somehow built actually. it didn't build on ci. i cleaned the build and it didn't build on local machine either.