pdvrieze / xmlutil

XML Serialization library for Kotlin
https://pdvrieze.github.io/xmlutil/
Apache License 2.0
363 stars 30 forks source link

Android Project - Failed to resolve: io.github.pdvrieze.xmlutil:core-base:0.90.0-RC3 #214

Closed tagy closed 3 weeks ago

tagy commented 4 weeks ago

Have this in my build.gradle and it works fine:

implementation("io.github.pdvrieze.xmlutil:core-android:0.86.3") implementation("io.github.pdvrieze.xmlutil:serialization-android:0.86.3")

But updating it to:

implementation("io.github.pdvrieze.xmlutil:core-android:0.90.0-RC3") implementation("io.github.pdvrieze.xmlutil:serialization-android:0.90.0-RC3")

Gives me: Failed to resolve: io.github.pdvrieze.xmlutil:core-base:0.90.0-RC3

More details shows:

`No matching variant of io.github.pdvrieze.xmlutil:core-base:0.90.0-RC3 was found. The consumer was configured to find a library for use during compile-time, preferably optimized for Android, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.4.1' but:

pdvrieze commented 4 weeks ago

I've managed to reproduce it. I'll be removing the hijinks with packages. Instead the JVM/Android specific code will not be included automatically by depending on core (but will be included for serialization).

FooIbar commented 3 weeks ago

It still persists on 0.90.0

No matching variant of io.github.pdvrieze.xmlutil:core:0.90.0 was found.

  • Variant 'jvmCommonApiElements-published' declares a library for use during compile-time, preferably optimized for standard JVMs:
    • Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm'
pdvrieze commented 3 weeks ago

Can you share some of your configuration. It should be permissible for the jvm variant to resolve against Android (it will work).

FooIbar commented 3 weeks ago
serialization-xml-core = { module = "io.github.pdvrieze.xmlutil:core-android", version.ref = "xmlutil" }
serialization-xml = { module = "io.github.pdvrieze.xmlutil:serialization-android", version.ref = "xmlutil" }

Here is the build log: https://github.com/FooIbar/EhViewer/actions/runs/9498750818/job/26178131607

lihenggui commented 3 weeks ago

Same error happened in this project: https://github.com/lihenggui/blocker/actions/runs/9499196227/job/26179580664

hfhbd commented 3 weeks ago

Just a curious qustion, why do you create an jvm target named android manually instead using the androidTarget which will setup all correct Gradle attributes automatically?

pdvrieze commented 3 weeks ago

@hfhbd The reason is that this is not build against the Android SDK (creating an AAR), but it is actually just a regular Jar that is optimized for use in Android. I actually found the cause, there is an explicit dependency on the now no longer existing android variant of core. It should be fixed soon (0.90.1)

JordanLongstaff commented 3 weeks ago

How soon will it release?

pdvrieze commented 3 weeks ago

I am releasing it now, it should be soon.