When i try to run the project i have the error below. What i tried:
* Install Java 11
* Change the JAVA_HOME path
* When i write java -version it is 11
* When i write flutter doctor -v it seems 1.8
* In android studio -> settings -> build, execution, depoloyment -> Gradle (I can not see the gradle projects part)
* So i can not solve it.
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
Build file 'C:\srcFlutter\MainFile_SourceCode\prokit_flutter\prokit_flutter\android\app\build.gradle' line: 14
* 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`.
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
BU�LD FAILED in 1s
Exception: Gradle task assembleDebug failed with exit code 1
Asked 5 days ago on September 14, 2021 5:10 PM Comments 1 times
4 days ago on September 15, 2021 4:52 AM
Hello Yavuz Burak Güzel,
Please follow this link for resolving the java 11 issue.