Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature Request: Add jvm target support #8

Closed
aaliomer opened this issue Sep 1, 2024 · 4 comments · Fixed by #13
Closed

Feature Request: Add jvm target support #8

aaliomer opened this issue Sep 1, 2024 · 4 comments · Fixed by #13
Labels
enhancement New feature or request
Milestone

Comments

@aaliomer
Copy link

aaliomer commented Sep 1, 2024

Hi. I'm getting the following error when i gradle build my project

jayjay@jays-MacBook-Air savior-backend % ./gradlew build
> Task :compileKotlin FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2.
     Required by:
         project :
      > No matching variant of com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 was found. The consumer was configured to find a library for use during compile-time, compatible with Java 21, 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 'debugApiElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'debugRuntimeElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'debugSourcesElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)
          - Variant 'iosArm64ApiElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosArm64MetadataElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosArm64SourcesElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a library for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosSimulatorArm64ApiElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosSimulatorArm64MetadataElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosSimulatorArm64SourcesElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a library for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosX64ApiElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-api', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosX64MetadataElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'iosX64SourcesElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native' and the consumer needed a library for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'metadataApiElements' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library:
              - Incompatible because this component declares a component for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'metadataSourcesElements' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component, and its dependencies declared externally:
              - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a library for use during compile-time, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'releaseApiElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'releaseRuntimeElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - 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 21)
                  - Doesn't say anything about its elements (required them preferably in the form of class files)
          - Variant 'releaseSourcesElements-published' capability com.collectiveidea.twirp:twirp-kmm-runtime:0.3.2 declares a component for use during runtime, packaged as a jar, and its dependencies declared externally:
              - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm'
              - 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 21)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 638ms
2 actionable tasks: 2 executed
jayjay@jays-MacBook-Air savior-backend % 



@darronschall
Copy link
Contributor

Do you have a jvm target in your project? This library is Kotlin Multiplatform but only provides support for Android and iOS targets.

@aaliomer
Copy link
Author

aaliomer commented Sep 1, 2024 via email

@darronschall
Copy link
Contributor

Sure, I'll look into it. The runtime library is relatively simple and doesn't have code outside of commonMain... so as long as our dependencies support the jvm target, we should be able to trivially add it.

I've been holding off on releasing a new version until Ktor 3 is released, but I could also stand to release a new version with updated dependencies anyway.

@darronschall darronschall changed the title Cant build as a dependency with java 21 Feature Request: Add jvm target support Sep 1, 2024
@darronschall darronschall added the enhancement New feature or request label Sep 1, 2024
@aaliomer
Copy link
Author

aaliomer commented Sep 1, 2024 via email

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants