Flutter 打包提示 Android Gradle plugin pequires Java 11 to run. .You are currently using Java 1.8

发布于 1 年前 作者 phonegap100 414 次浏览 最后一次编辑是 1 个月前 来自 分享

Flutter 打包提示 Android Gradle plugin pequires Java 11 to run. .You are currently using Java 1.8

详细错误如下:

Build file "/Users/liucheng/Documents/work/android/flutter/flutter_app/android/app/build.gradle' line: 24
* What went wrong:0A problem occurred evaluating project ! :app! .> Failed to apply plugin.' com.android.internal.application'.> Android Gradle plugin pequires Java 11 to run. .You are currently using Java 1.8.Your currentJDK is located in /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jreYou can try some of the following options;- changing  the IDE settings.- changingkthe JAVA HOME environment variable.- changing org,gradle.java.home  in .gradle.properties> Run with --scan to get full insights.
* Try:> Run with --stacktrace option to get the stack trace.> Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 704ms

错误截图如下:

a.jpg

flutter doctor截图如下:

f-a.jpg

Flutter 打包提示 Android Gradle plugin pequires Java 11 to run. .You are currently using Java 1.8 原因分析

主要原因是flutter3.7.7版本和 jdk1.8的版本不匹配

解决方法:

方法1:升级jdk版本 也就是安装jdk-19_windows-x64_bin.exe , 然后重新配置一下jdk环境变量

方法2:jdk不用管,降低一下flutter sdk版本,降低到3.3.x以下

获取jdk也可以联系客服:

wx.png

2024年最新Flutter入门实战网盘地址分享:http://bbs.itying.com/topic/620268d1a4bcc00fe8e9d6e1

回到顶部