I followed the steps in the Flutter document and tried to build my first Flutter app in Intellij IDEA. And when I try to run it,there was an error about my JAVA_HOME variabl
I tried all other suggestions, and they did not help. Then I have removed "new" in front of GradleException, and it solved the problem:
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
It worked perfectly fine with the "new" word for a long time. I don't know what have caused this change.