Not able to Find compatible version of embedded java version and gradle tools version for Android Studio Flamingo

huangapple go评论50阅读模式
英文:

Not able to Find compatible version of embedded java version and gradle tools version for Android Studio Flamingo

问题

I tried with jdk 17 and 18 its giving me the same issue
> Could not resolve all files for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:8.0.0.

Required by:
project : > com.android.application:com.android.application.gradle.plugin:8.0.0
project : > com.android.library:com.android.library.gradle.plugin:8.0.0

No matching variant of com.android.tools.build:gradle:8.0.0 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.0' but:

  • Variant 'apiElements' capability com.android.tools.build:gradle:8.0.0 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.0')

  • Variant 'javadocElements' capability com.android.tools.build:gradle:8.0.0 declares a component for use during runtime, and its dependencies declared externally:

  • Incompatible because this component declares documentation and the consumer needed a library

  • Other compatible attributes:

  • Doesn't say anything about its target Java version (required compatibility with Java 8)

  • Doesn't say anything about its elements (required them packaged as a jar)

  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0')

  • Variant 'runtimeElements' capability com.android.tools.build:gradle:8.0.0 declares a library for use during runtime, 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 '8.0')

  • Variant 'sourcesElements' capability com.android.tools.build:gradle:8.0.0 declares a component for use during runtime, and its dependencies declared externally:

  • Incompatible because this component declares documentation and the consumer needed a library

  • Other compatible attributes:

  • Doesn't say anything about its target Java version (required compatibility with Java 8)

  • Doesn't say anything about its elements (required them packaged as a jar)

  • Doesn't say anything about org.gradle.plugin.api-version (required '8.0')

If anyone else also faced the same issue with android studio flamingo please suggest some solutions.

英文:

I tried with jdk 17 and 18 its giving me the same issue
Not able to Find compatible version of embedded java version and gradle tools version for Android Studio Flamingo

> Could not resolve all files for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:8.0.0.

Required by:
project : > com.android.application:com.android.application.gradle.plugin:8.0.0
project : > com.android.library:com.android.library.gradle.plugin:8.0.0

No matching variant of com.android.tools.build:gradle:8.0.0 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.0' but:

  • Variant 'apiElements' capability com.android.tools.build:gradle:8.0.0 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.0')
  • Variant 'javadocElements' capability com.android.tools.build:gradle:8.0.0 declares a component for use during runtime, and its dependencies declared externally:

    • Incompatible because this component declares documentation and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about its target Java version (required compatibility with Java 8)
      • Doesn't say anything about its elements (required them packaged as a jar)
      • Doesn't say anything about org.gradle.plugin.api-version (required '8.0')
  • Variant 'runtimeElements' capability com.android.tools.build:gradle:8.0.0 declares a library for use during runtime, 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 '8.0')
  • Variant 'sourcesElements' capability com.android.tools.build:gradle:8.0.0 declares a component for use during runtime, and its dependencies declared externally:

    • Incompatible because this component declares documentation and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about its target Java version (required compatibility with Java 8)
      • Doesn't say anything about its elements (required them packaged as a jar)
      • Doesn't say anything about org.gradle.plugin.api-version (required '8.0')

If anyone else also faced the same issue with android studio flamingo please suggest some solutions.

答案1

得分: 2

在设置中更改Gradle Java JDK为17,可能会解决您的问题。

英文:

Change in Settings->Gradle Java JDK to 17 it maybe solves your problem

huangapple
  • 本文由 发表于 2023年4月17日 22:19:15
  • 转载请务必保留本文链接:https://go.coder-hub.com/76036154.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定