Flutter error Kotlin could not find the required JDK tools
Step1:
I added the following line to the gradle.properties file
org.gradle.java.home=C:\\Program Files\\Java\\jdk1.8.0_261
your jdk version
Step2:
add the following line to gradle-wrapper.properties file
to the address => \flutter_app\android\gradle\wrapper\gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
One of these two methods should help you:
- In
gradle.properties
in the.gradle
directory in yourHOME_DIRECTORY
setorg.gradle.java.home=/path_to_jdk_directory
OR:
- In your
build.gradle
compileJava.options.fork = truecompileJava.options.forkOptions.executable = '/path_to_javac'