Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot use KotlinPoet version 1.7.0 with Java 8 #999

Closed
martinbonnin opened this issue Oct 14, 2020 · 2 comments · Fixed by #1000
Closed

Cannot use KotlinPoet version 1.7.0 with Java 8 #999

martinbonnin opened this issue Oct 14, 2020 · 2 comments · Fixed by #1000

Comments

@martinbonnin
Copy link
Contributor

The latest 1.7.0 version declares "org.gradle.jvm.version": 11 which makes it impossible to compile for Java 8:

      > No matching variant of com.squareup:kotlinpoet:1.7.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, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
          - Variant 'apiElements' capability com.squareup:kotlinpoet:1.7.0 declares an API of a library, packaged as a jar, 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 'runtimeElements' capability com.squareup:kotlinpoet:1.7.0 declares a runtime of a library, packaged as a jar, 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
@Egorand
Copy link
Collaborator

Egorand commented Oct 15, 2020

1.7.1 has been published and should be available shortly. Thanks for reporting!

@Egorand Egorand closed this as completed Oct 15, 2020
@JakeWharton JakeWharton reopened this Oct 15, 2020
@JakeWharton
Copy link
Collaborator

The deployment JDK shouldn't matter. The fix is to declare 8 as the source/target compatibility which will get propagated into Gradle metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants