KStateMachine / kstatemachine

KStateMachine is a powerful Kotlin Multiplatform library with clean DSL syntax for creating complex state machines and statecharts driven by Kotlin Coroutines.
https://kstatemachine.github.io/kstatemachine/
Boost Software License 1.0
358 stars 21 forks source link

Java 8 compatibility #52

Closed gigitalz closed 1 year ago

gigitalz commented 2 years ago

I run into this issue in version 0.15.0 upon compilation. 0.14.0 works fine.

Any workaround to use 0.15.0 ?

> Error while evaluating property 'filteredArgumentsMap' of task ':backend:compileKotlin'
   > Could not resolve all files for configuration ':backend:compileClasspath'.
      > Could not resolve io.github.nsk90:kstatemachine:0.15.0.
        Required by:
            project :backend
         > No matching variant of io.github.nsk90:kstatemachine:0.15.0 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, 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.github.nsk90:kstatemachine:0.15.0 declares an API of 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 compatible with Java 11 and the consumer needed a component compatible with Java 8
             - Variant 'javadocElements' capability io.github.nsk90:kstatemachine:0.15.0 declares a runtime of a component, 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 8)
                     - Doesn't say anything about its elements (required them preferably in the form of class files)
                     - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
             - Variant 'runtimeElements' capability io.github.nsk90:kstatemachine:0.15.0 declares a runtime of 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 compatible with Java 11 and the consumer needed a component compatible with Java 8
             - Variant 'sourcesElements' capability io.github.nsk90:kstatemachine:0.15.0 declares a runtime of a component, 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 8)
                     - Doesn't say anything about its elements (required them preferably in the form of class files)
                     - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
nsk90 commented 2 years ago

looks like a bug, I will check and rebuild if necessary to be compatible with java 8.

nsk90 commented 1 year ago

I reproduced this issue on a library from maven central. (using java8 for gradle in a sample project) Moreover artefact on maven central is not backward compatible with kotlin older than 1.7.

But my local builds of the same version are working as expected. And this issue is not reproduced. I'm confused.

nsk90 commented 1 year ago

this issue is not resolved yet.

now artifacts from maven central and jitpack work the same way.

java8 + kotlin 1.6 and 1.7 works on my sample project (1.4 & 1.5 does not) (tested on library version 0.18.0)

gigitalz commented 1 year ago

Sure but the issue was with Java 8 in my case, so it should be gone.