问题:
* What went wrong:
A problem occurred configuring root project 'Calculate'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:8.1.1.
Required by:
project : > com.android.application:com.android.application.gradle.plugin:8.1.1
> No matching variant of com.android.tools.build:gradle:8.1.1 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.1.1' but:
- Variant 'apiElements' capability com.android.tools.build:gradle:8.1.1 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '8.1.1')
解决办法:jdk版本配置问题
将配置改成合适的版本