I am trying to build an android SDK but I get this error while syncing.
A problem occurred configuring project ':mymodule'.
> Could not resolve all files for configuration ':mymodule:classpath'.
> Could not resolve mypkg:mylib:1.0.0.
Required by:
project :mymodule
> No matching variant of mypkg:mylib:1.0.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5.1' but:
- Variant 'apiElements' capability mypkg:mylib:1.0.0 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
- Variant 'runtimeElements' capability mypkg:mylib:1.0.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.5.1')
I am using Gradle 7.5.1 and as far as possible specified usage of Java 11. Any idea how to debug further or fix this issue?