viascom / nanoid-kotlin

Nano ID for Kotlin
Apache License 2.0
27 stars 3 forks source link

Unable to use library, gradle build fails #8

Closed krukru closed 10 months ago

krukru commented 10 months ago

Hi,

I tried installing io.viascom.nanoid:nanoid:1.0.0 in my kotlin project but I am getting a gradle build error, something about java versions being incompatible.

This is the stack error I am getting.

   > Could not resolve io.viascom.nanoid:nanoid:1.0.0.
     Required by:
         project :
      > No matching variant of io.viascom.nanoid:nanoid:1.0.0 was found. The consumer was configured to find a library for use during runtime, compatible with Java 17, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'apiElements' capability io.viascom.nanoid:nanoid:1.0.0 declares a library, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component for use during compile-time, compatible with Java 19 and the consumer needed a component for use during runtime, compatible with Java 17
          - Variant 'javadocElements' capability io.viascom.nanoid:nanoid:1.0.0 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
          - Variant 'runtimeElements' capability io.viascom.nanoid:nanoid:1.0.0 declares a library for use during runtime, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
              - Incompatible because this component declares a component, compatible with Java 19 and the consumer needed a component, compatible with Java 17
          - Variant 'sourcesElements' capability io.viascom.nanoid:nanoid:1.0.0 declares a component for use during runtime, and its dependencies declared externally:
              - Incompatible because this component declares documentation and the consumer needed a library
              - Other compatible attributes:
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 17)
                  - Doesn't say anything about its elements (required them packaged as a jar)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')

I have java 17 on my machine, and I think the error message is telling me I need 19 for this to work? Am I reading this right, can you lower the minimum compatible version to at least Java 17?

nik-sta commented 10 months ago

Hi @krukru. Thanks for opening an issue; let me check our code. I'm coming back as soon as possible with a solution.

itsmefox commented 10 months ago

We lowered the jvmTarget to 17 in version 1.0.1