我匯入了一個 Flutter 專案,當我嘗試運行它時,我收到了這個訊息錯誤:
FAILURE: Build failed with an exception.
* Where:
Build file '/home/omer358/FlutterProjects/MyProjects/ConverterNOW/android/app/build.gradle' line: 24
* What went wrong:
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`.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 22s
Exception: Gradle task assembleDebug failed with exit code 1
我搜索了一些解決方案,其中一個建議我使用的是 java1.8,但事實并非如此!
omer358@OMO:~/FlutterProjects/MyProjects/ConverterNOW/android$ ./gradlew --version
------------------------------------------------------------
Gradle 7.0.2
------------------------------------------------------------
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 11.0.14 (Ubuntu 11.0.14 9-Ubuntu-0ubuntu2.22.10)
OS: Linux 5.13.0-35-generic amd64
你能幫我弄走嗎!
uj5u.com熱心網友回復:
你的地方設定好了嗎?
gradle java版本是不是太低了
JAVA_HOME D:\Android\Android Studio\jre
%JAVA_HOME%\bin

轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/445971.html
上一篇:用可迭代替換切片
