简体   繁体   English

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

[英]Android - Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.0

Some time ago i upgraded android studio kotlin version from 1.6.21 to 1.7.0.前段时间我将android studio kotlin版本从1.6.21升级到1.7.0。 Every time I open a view in the project automatically changes its version('org.jetbrains.kotlin.android') from 1.6.21 to 1.7.0.每次我在项目中打开视图时,都会自动将其版本('org.jetbrains.kotlin.android')从 1.6.21 更改为 1.7.0。 Because of this, the project gives an error.因此,该项目给出了错误。 I don't have a problem trying it in intellij.在intellij中尝试它没有问题。 libraries not updating automatically库不会自动更新

 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

org.jetbrains.kotlin.android is available from gradlePluginPortal() or mavenCentral() . org.jetbrains.kotlin.android可从gradlePluginPortal()mavenCentral()
Don't use version 1.6.21 and 1.7.0 at the same time, this is absurd and may cause issues.不要同时使用1.6.211.7.0版本,这很荒谬,可能会导致问题。

Make sure to upgrade gradle to the latest version.确保将 gradle 升级到最新版本。

You can follow this excellent description on how to do that here .您可以在此处了解如何执行此操作的出色说明。 I guess nowadays starting at step 2 is enough.我想现在从第 2 步开始就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android Studio 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10 - Android Studio could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10 react-native-webview 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11 - react-native-webview Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11 无法解析 org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10 - Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10 没有 org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 的缓存版本可用于离线模式错误 - No cached version of org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21 available for offline mode Error IONIC ISSUE无法解析org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 - IONIC ISSUE Could not resolve org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 Gradle 构建失败:找不到 org.jetbrains.kotlin 即使我没有使用 Kotlin - Gradle build failed : could not find org.jetbrains.kotlin even if I haven't used Kotlin 无法解决:org.jetbrains.kotlin:kotlin-stdlib - Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib Gradle 同步失败:找不到 org.jetbrains.kotlin(无意使用 Kotlin) - Gradle sync failed: Could not find org.jetbrains.kotlin (no intention to use Kotlin) 找不到 kotlin-gradle-plugin - Could not find kotlin-gradle-plugin Android Studio-找不到org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2 - Android Studio - Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM