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

pbandk release can't be used on a Java 1.8 project #211

Closed
lucagonzalez opened this issue Mar 16, 2022 · 2 comments · Fixed by #212
Closed

pbandk release can't be used on a Java 1.8 project #211

lucagonzalez opened this issue Mar 16, 2022 · 2 comments · Fixed by #212
Assignees
Labels
bug Something isn't working
Milestone

Comments

@lucagonzalez
Copy link

lucagonzalez commented Mar 16, 2022

So, I have pbandk imported on my build.gradle.kts like:

implementation("pro.streem.pbandk:pbandk-runtime:0.13.1-SNAPSHOT")

I also have this configureEach that seemed necessary for pbandk to work with Java 1.8

tasks.withType<KotlinCompile>().configureEach { kotlinOptions { jvmTarget = "1.8" } }

However, I'm having trouble compiling my project:

Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT.
     Required by:
         project : > pro.streem.pbandk:pbandk-runtime:0.13.1-SNAPSHOT:20211209.004302-1 > pro.streem.pbandk:pbandk-runtime-jvm:0.13.1-SNAPSHOT:20211209.004302-1
      > No matching variant of pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT:20211209.004302-1 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 pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT 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 'javadocElements' capability pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT 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 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 pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT 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
          - Variant 'sourcesElements' capability pro.streem.pbandk:pbandk-protos:0.13.1-SNAPSHOT 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 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')

Is there a different way to import pbandk so I can use Java 1.8? I was not intending to use Java 1.8 but it seems necessary to use if I want to point my Firebase settings to local.

@garyp
Copy link
Collaborator

garyp commented Mar 16, 2022

Most of our day-to-day testing of pbandk is on Java 11, but we do support using pbandk with Java 8. This looks like a possible bug in the gradle config of the pbandk-protos component. I'll take a look.

@garyp garyp added the bug Something isn't working label Mar 16, 2022
@garyp garyp added this to the 0.13.0 milestone Mar 16, 2022
garyp added a commit that referenced this issue Mar 17, 2022
Without an explicit definition of the Java language version, gradle
will default to building artifacts that depend on the same version of
Java that gradle was running under. To guarantee that we don't break
compatibility with existing pbandk users, we need to explicitly tell
gradle to set the language version older than the currently-running Java
version.

Fixes #211.
garyp added a commit that referenced this issue Mar 17, 2022
Without an explicit definition of the Java language version, gradle
will default to building artifacts that depend on the same version of
Java that gradle was running under. To guarantee that we don't break
compatibility with existing pbandk users, we need to explicitly tell
gradle to set the language version older than the currently-running Java
version.

Also update the example project to use Java 8 when building to ensure
that pbandk works correctly in a Java 8 project.

Fixes #211.
@garyp garyp self-assigned this Mar 17, 2022
@garyp garyp modified the milestones: 0.13.0, 0.13.1 Mar 17, 2022
garyp added a commit that referenced this issue Mar 17, 2022
Update pbandk-protos library to be Java 8 compatible
@garyp
Copy link
Collaborator

garyp commented Mar 17, 2022

This is now fixed in the latest SNAPSHOT builds (should be available in a few minutes) and will go out in the next release.

@garyp garyp modified the milestones: 0.13.1, 0.14.0 Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants