当我尝试构建时,出现以下依赖性解析错误:
> Could not resolve all files for configuration ':example:detachedConfiguration17'.> Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3.Required by:project :example> Cannot choose between the following variants of org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:- enforcedRuntimeElements- runtimeElementsAll of them match the consumer attributes:- Variant 'enforcedRuntimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:- Unmatched attributes:- Found org.gradle.category 'enforced-platform' but wasn't required.- Found org.gradle.status 'release' but wasn't required.- Found org.gradle.usage 'java-runtime' but wasn't required.- Variant 'runtimeElements' capability org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.3.3:- Unmatched attributes:- Found org.gradle.category 'platform' but wasn't required.- Found org.gradle.status 'release' but wasn't required.- Found org.gradle.usage 'java-runtime' but wasn't required.
这是一个纯Java项目(不使用Kotlin)。
解决办法:
通过从Gradle v5.6.4升级到v6.0.1