Upgrading to Gradle 5.4 causes: Unable to find a matching variant of project

Hi

I have a project with sub-projects. Everything builds ok when I’m using the gradle wrapper set to version 5.2. However when I upgrade to gradlew 5.4 I get the following error. I’ve been stuck on this problem for a couple of days now. Any suggestions?

Thanks, Derek

* What went wrong:
Could not determine the dependencies of task ':H**Sdk:compileJava'.
> Could not resolve all task dependencies for configuration ':H**Sdk:compileClasspath'.
   > Could not resolve project :NnnnWurksLib.
     Required by:
         project :H**Sdk
      > Unable to find a matching variant of project :NnnnWurksLib:
          - Variant 'apiElements' capability com.novawurks:NnnnWurksLib:0.0.000-dealy-SNAPSHOT:
              - Incompatible attribute:
                  - Required org.gradle.jvm.version '7' and found incompatible value '8'.

Hi,

This is a consequence of further validation included in dependency management.

It indicates that the current project, built with Java 6, uses a dependency built with Java 7, which should be invalid.

Have a look at the upgrade notes that detail what’s happening and provide a way to disable that check in case you do not want it.

Thanks for the tip, now that I understand the issue better I was able to address the issue by splitting that new stuff off into its own module and removing the Java 7 -> 8 dependency.