Hi there, I have a kotlin multiplatform library (p...
# library-development
a
Hi there, I have a kotlin multiplatform library (published on Maven Central), that targets android, jvm, js, wasm, and ios. This library has a lot of common code, and a few platform specific code on every listed platform above. I am depending on this library, on an application that targets ios, jvm, wasm and android. When compiling to ios, jvm, and wasm everything works well. But when compiling the android part, compiler fails to resolve those platform specific. What is the issue here?
The library has the maven coordinates
tz.co.asoft:kiota-file-compose:3.1.13
I have added the android specific dependency, but it is still not working
Copy code
val androidMain by getting {
  implementation("tz.co.asoft:kiota-file-compose-android:3.1.13")
}
When I ran the gradle task
dependencies --configuration androidDebugRuntimeClasspath
gradle logs it accordingly showing that it has been picked up by gradle
Copy code
|    \--- tz.co.asoft:kiota-file-compose-android:3.1.13
But somehow the compiler is failing to resolve
e
Android will fall back to JVM variant if any of the matching fails
a
Ahh, yes. Looks like I did not add, publishAndroidLibraryVariants. Thanks for helping
I published my library with
publishLibrariVariants("release")
but I am still getting the same error 😔 The
module
can be seen here https://repo.maven.apache.org/maven2/tz/co/asoft/kiota-file-compose/3.1.14/kiota-file-compose-3.1.14.module and it clearly has a releaseVariant for android
Could it be that it's source compatibility requires Java 17 and your project is using some other JavaVersion?
a
Nope, even project requires Java17