首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Android -无法解决org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0

Android -无法解决org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0
EN

Stack Overflow用户
提问于 2022-07-27 12:07:36
回答 2查看 2.7K关注 0票数 6

不久前,我将版本从1.6.21升级到1.7.0。每次打开项目中的视图时,都会自动将其版本(“org.jetbrains.kotlin.android”)从1.6.21更改为1.7.0。正因为如此,该项目出现了一个错误。我在intellij上试试看没有问题。不自动更新的库

代码语言:javascript
复制
 A problem occurred configuring root project 'dijital-kurye-android-app'.
 Could not resolve all artifacts for configuration ':classpath'.
 Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21.

 Required by:
     project :

  > The consumer was configured to find a runtime of a component compatible with Java 11, packaged as a jar, and its dependencies declared externally. However we cannot choose between the following variants of org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0:
      - gradle70JavadocElements
      - gradle70RuntimeElements
      - gradle70SourcesElements
      - javadocElements
      - runtimeElements
      - sourcesElements
    All of them match the consumer attributes:
      - Variant 'gradle70JavadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides documentation but the consumer didn't ask for it
              - Provides javadocs but the consumer didn't ask for it
              - Doesn't say anything about its target Java version (required compatibility with Java 11)
              - Doesn't say anything about its elements (required them packaged as a jar)
              - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it
              - Provides release status but the consumer didn't ask for it
      - Variant 'gradle70RuntimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides a library but the consumer didn't ask for it
              - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it
              - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it
              - Provides release status but the consumer didn't ask for it
              - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but the consumer didn't ask for it
      - Variant 'gradle70SourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides documentation but the consumer didn't ask for it
              - Provides sources but the consumer didn't ask for it
              - Doesn't say anything about its target Java version (required compatibility with Java 11)
              - Doesn't say anything about its elements (required them packaged as a jar)
              - Provides attribute 'org.gradle.plugin.api-version' with value '7.0' but the consumer didn't ask for it
              - Provides release status but the consumer didn't ask for it
      - Variant 'javadocElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides documentation but the consumer didn't ask for it
              - Provides javadocs but the consumer didn't ask for it
              - Doesn't say anything about its target Java version (required compatibility with Java 11)
              - Doesn't say anything about its elements (required them packaged as a jar)
              - Provides release status but the consumer didn't ask for it
      - Variant 'runtimeElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides a library but the consumer didn't ask for it
              - Provides attribute 'org.gradle.jvm.environment' with value 'standard-jvm' but the consumer didn't ask for it
              - Provides release status but the consumer didn't ask for it
              - Provides attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but the consumer didn't ask for it
      - Variant 'sourcesElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a runtime of a component, and its dependencies declared externally:
          - Unmatched attributes:
              - Provides documentation but the consumer didn't ask for it
              - Provides sources but the consumer didn't ask for it
              - Doesn't say anything about its target Java version (required compatibility with Java 11)
              - Doesn't say anything about its elements (required them packaged as a jar)
              - Provides release status but the consumer didn't ask for it
    The following variants were also considered but didn't match the requested attributes:
      - Variant 'apiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:
          - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
      - Variant 'gradle70ApiElements' capability org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0 declares a component compatible with Java 8, packaged as a jar, and its dependencies declared externally:
          - Incompatible because this component declares an API of a component and the consumer needed a runtime of a component
EN

回答 2

Stack Overflow用户

发布于 2022-07-27 12:24:57

org.jetbrains.kotlin.android可以从gradlePluginPortal()mavenCentral()获得。

不要同时使用1.6.211.7.0版本,这是荒谬的,可能会引起问题。

票数 1
EN

Stack Overflow用户

发布于 2022-09-16 08:50:47

确保将gradle升级到最新版本。

您可以遵循以下关于如何执行here的出色描述。我想现在从第二步开始就够了。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73137646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档