在Android Studio Flamingo上遇到了与Gradle和JDK相关的”Unsupported Java”错误。

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

Getting "Unsupported Java" Gradle and JDK related error on Android Studio Flamingo

问题

我在经过9年之后重新开始我的Android开发之旅,但是当我尝试在Android Studio v2022.2.1上构建我的第一个项目时,我遇到了这个错误:

不支持的Java。
您的构建当前配置为使用Java 20.0.1和Gradle 8.0。

可能的解决方案:
- 打开Gradle包装器设置,将`distributionUrl`属性更改为使用兼容的Gradle版本,然后重新加载项目

我在Stack Overflow上搜索了解决方案,并注意到这主要与Gradle属性和版本问题有关,大多数解决方案建议升级Gradle版本至7.4+或降级JDK版本。

但是,我已经在我的操作系统(Windows 10操作系统x64架构)上使用了Gradle v8.0和最新的JDK。那么,问题可能是什么呢?

我已经尝试了这两个Stack Overflow答案中列出的以下步骤:

但问题仍然存在。

英文:

I am restarting my Android development journey after 9 years, but when I try building my first project on Android Studio v2022.2.1, I encounter this error:

Unsupported Java. 
Your build is currently configured to use Java 20.0.1 and Gradle 8.0.

Possible solution:
 - Open Gradle wrapper settings, change `distributionUrl` property to use compatible Gradle version and reload the project

I searched for solutions on Stack Overflow and noticed that it's primarily related to Gradle properties and version issues, and most of the solutions recommended to either upgrade the Gradle version to 7.4+ or downgrade the JDK version.

But, I am already using Gradle v8.0 and latest JDK, available for my OS (Windows 10 OS x64 architecture). So, what could be the issue.

I have already attempted the following steps listed in these 2 Stack Overflow answers:

But the issue persists.

答案1

得分: 2

在“项目结构”菜单中 -> SDK位置 -> Gradle设置中,将Gradle JDK设置为内置的JSD 17.0.6。

英文:

In the Project Structure menu -> SDK Location -> Gradle settings, set Gradle JDK to embedded JSD 17.0.6

huangapple
  • 本文由 发表于 2023年6月1日 15:38:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/76379660.html
匿名

发表评论

匿名网友

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

确定