繁体   English   中英

Android gradle 插件需要 java 11

[英]Android gradle plugin requires java 11

这真的让我很沮丧,我为此寻找解决方案,但我没有任何工作。 if check on terminal my java version, it's version 16 but when i try to run flutter in android emulator it read java 1.8. 我在 macOS Monterey 和 msvcode 上运行

A problem occurred evaluating project ':app'.
Failed to apply plugin 'com.android.internal.application'.
   Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

我认为你必须升级你的 JDK 版本并使其 1.8 到 11

在此处输入图像描述

sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11

1.在 Android Studio 中,导航到 File -> Project Structure 或按 Ctrl+Alt+Shift+S 打开项目结构。
2.In Platform Settings -> SDKS -> Android API -> Java SDK (Now choose JDK as per your requirement).

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM