Skip to content

Conversation

@oguzkocer
Copy link
Contributor

We have had couple reports where developers had the error below. I've not had this error myself and haven't seen it in CI, so it went unnoticed so far. My understanding is that this is happening because this project is using a different version of Java and this check is not liking that. I've considered setting java version to 11 across projects, but that creates some errors and I think it requires Gradle 7.0 and Android Gradle Plugin 4.2.

Long story short, this PR sets the java compatibility to java 8 so it's consistent with other projects and we don't have the error below.

A problem occurred configuring project ':WordPress-Utils-Android:WordPressUtils'.
> Could not resolve all artifacts for configuration ':WordPress-Utils-Android:WordPressUtils:classpath'.
   > Could not resolve com.automattic.android:publish-to-s3:0.2.2.
     Required by:
         project :WordPress-Utils-Android:WordPressUtils
      > Unable to find a matching variant of com.automattic.android:publish-to-s3:0.2.2:
          - Variant 'apiElements' capability com.automattic.android:publish-to-s3:0.2.2:
              - Incompatible attributes:
                  - Required org.gradle.jvm.version '8' and found incompatible value '11'.
                  - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
              - Other attributes:
                  - Found org.gradle.category 'library' but wasn't required.
                  - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'.
                  - Required org.gradle.libraryelements 'jar' and found compatible value 'jar'.
                  - Found org.gradle.status 'release' but wasn't required.
                  - Found org.jetbrains.kotlin.localToProject 'public' but wasn't required.
                  - Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.
          - Variant 'runtimeElements' capability com.automattic.android:publish-to-s3:0.2.2:
              - Incompatible attribute:
                  - Required org.gradle.jvm.version '8' and found incompatible value '11'.
              - Other attributes:
                  - Found org.gradle.category 'library' but wasn't required.
                  - Required org.gradle.dependency.bundling 'external' and found compatible value 'external'.
                  - Required org.gradle.libraryelements 'jar' and found compatible value 'jar'.
                  - Found org.gradle.status 'release' but wasn't required.
                  - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.
                  - Found org.jetbrains.kotlin.localToProject 'public' but wasn't required.
                  - Found org.jetbrains.kotlin.platform.type 'jvm' but wasn't required.

@oguzkocer
Copy link
Contributor Author

I forgot to mention that I've tested these changes in wordpress-mobile/WordPress-Utils-Android#80 and got a 👍 from @mzorz that it fixed the issue.

@oguzkocer oguzkocer merged commit 9369148 into trunk May 26, 2021
@oguzkocer oguzkocer deleted the java-8 branch May 26, 2021 20:50
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 this pull request may close these issues.

3 participants