Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

这篇具有很好参考价值的文章主要介绍了Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

报错信息
Unsupported Java. 
Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

Possible solution:
 - Upgrade Gradle wrapper to 7.2 version and re-import the project

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

Could not open cp_init remapped class cache for dw5ezsq9vnujkjvxyvhfx35dd (C:\Users\lenovo\.gradle\caches\5.6.4\scripts-remapped\ijmapper_39sxepuidel0xqznotomv6j9k\dw5ezsq9vnujkjvxyvhfx35dd\cp_initb88fbed980d87867994e661e74c75e1f).
> Could not open cp_init generic class cache for initialization script 'C:\Users\lenovo\AppData\Local\Temp\ijmapper.gradle' (C:\Users\lenovo\.gradle\caches\5.6.4\scripts\dw5ezsq9vnujkjvxyvhfx35dd\cp_init\cp_initb88fbed980d87867994e661e74c75e1f).
   > Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.cache.CacheOpenException: Could not open cp_init remapped class cache for dw5ezsq9vnujkjvxyvhfx35dd (C:\Users\lenovo\.gradle\caches\5.6.4\scripts-remapped\ijmapper_39sxepuidel0xqznotomv6j9k\dw5ezsq9vnujkjvxyvhfx35dd\cp_initb88fbed980d87867994e661e74c75e1f).
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:80)
	at org.gradle.cache.internal.DefaultPersistentDirectoryStore.open(DefaultPersistentDirectoryStore.java:42)
	at org.gradle.cache.internal.DefaultCacheFactory.doOpen(DefaultCacheFactory.java:95)
	at org.gradle.cache.internal.DefaultCacheFactory.open(DefaultCacheFactory.java:68)
	at org.gradle.cache.internal.DefaultCacheRepository$PersistentCacheBuilder.open(DefaultCacheRepository.java:126)
	at 
	... 135 more

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

错误原因

因为项目所需的gradle5.6.4对应的是java8,而Android Studio Flamingo | 2022.2.1 Patch 1自带的java版本为17,它会使用默认的java版本去编译项目,所以编译时导致报错。

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

解决方法

1、安装jdk1.8:Win10如何安装JDK1.8,最快最详细教程

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

2、安装并配置好环境后,输入命令查看是否安装成功,如下信息为成功。

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

3、进入Gradle配置,选择Gradle JDK,可以看到检测到了我们的jdk1.8,选中它。

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.
4、点击Apply,点击OK,然后再次同步项目。

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

5、同步过程中,会出现Windows安全提示,选择允许jdk1.8访问。

Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.

不要跟不讲理的人争论,否则就中了她的招,因为她一直认为自己是对的,最后生气的是自己。文章来源地址https://www.toymoban.com/news/detail-505207.html

到了这里,关于Your build is currently configured to use Java 17.0.6 and Gradle 5.6.4.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包