简体   繁体   中英

Flutter "You need Java 11 or higher to build your app with this version of Gradle." error

When i create a new project, and press run i get this error.

在此处输入图像描述

The fact is i do already have jdk verison of 15 and my previously created projects do open and run without any errors. Also, if i add org.gradle.java.home=C:/Program Files/Java/jdk-15.0.1 line to my gradle.properties file the app runs without error but this way just does not seems right way to do it.

I have tried to change the SDK version from the project structure like some other questions and answers but it did not worked either. As an additon to other problems i do not have the same project structure screen as they showed so.

在此处输入图像描述

在此处输入图像描述

I do not know what to do right now, i would be very grateful if you could help me.

You should delete .gradle folder under user name. Then again run your project.

在此处输入图像描述

change gradle to 4.1.0 and it will be run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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