0

After changing my project's build.gradle to use a new version of a Gradle plugin which does a whole bunch of stuff (hard to isolate root cause), I get the following error when running resolveAndLockAll --write-locks to update the project's lockfiles.

Execution failed for task ':resolveAndLockAll'.
> Could not resolve all files for configuration ':allCodeCoverageReportSourceDirectories'.
   > Could not resolve com.google.protobuf:protobuf-java:3.15.7.
     Required by:
         project : > project :my-project
      > No matching variant of com.google.protobuf:protobuf-java:3.21.4 was found. The consumer was configured to find a component of category 'verification', and its dependencies declared externally, as well as attribute 'org.gradle.verificationtype' with value 'main-sources' but:
          - Variant 'compile' capability com.google.protobuf:protobuf-java:3.21.4:
              - Incompatible because this component declares a library and the consumer needed a component of category 'verification'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about org.gradle.verificationtype (required 'main-sources')
          - Variant 'enforced-platform-compile' capability com.google.protobuf:protobuf-java-derived-enforced-platform:3.21.4:
              - Incompatible because this component declares an enforced platform and the consumer needed a component of category 'verification'
              - Other compatible attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about org.gradle.verificationtype (required 'main-sources')
.
.
.
[TRUNCATED]

I am unable to understand what the error message is actually trying to communicate.

In the context of this error message, what is meant by the following terms?:

  • Variant capability
  • Compatible variant capability
  • Compatible attribute
  • Enforced platform
  • Consumer
  • Component of category 'verification'
  • Dependencies declared externally
Toldry
  • 485
  • 1
  • 4
  • 13
  • After digging deeper, I found that this was caused by `JacocoReportAggregationPlugin` not working with lockfiles, and I opened a bug for Gradle: https://github.com/gradle/gradle/issues/22918 – Toldry Nov 30 '22 at 16:04

1 Answers1

-1

The meaning of most of these terms is covered in this use guide:

https://docs.gradle.org/current/userguide/dependency_management_terminology.html

Toldry
  • 485
  • 1
  • 4
  • 13