簡體   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