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've just had this issue and in my case was due to an invalid SDK configuration. I've solved by going to:
Project structure > Project Settings > Modules > Module SDK
and switching from <no project SDk>
to Android api 29 platform
I have same problem. I get this error because I edit android module without open it first using AS in another tab (Tools -> Flutter -> Open Android module..). Then I have a solution, just restart and kill the chache in your Android Studio (File -> Invalidate Chache / Restart).
It fixed for me, I hope you too
https://github.com/flutter/flutter/issues/29608#issuecomment-528243662
Go to File -> Project Structure -> Modules -> Select your project -> apply your API
Yes, i follow this https://github.com/flutter/flutter/issues/37391#issuecomment-544823712 and i change GraddleException to FileNotFoundException in android/app/build.gradle. Otherwise upgrade kotlin version in android/build.gradle to 1.3.50. At least, upgrade gradle distributionUrl to version 5.4.1
Update: Oct. 15, 2020.
I am running Flutter Version 1.12.13+hotfix9 in Android Studio Version 4.1 (re-installed today) with runtime version 1.8.0_242-release-1644.... on Windows 10, amd64.
I repaired both the project level and app level gradle build files by removing the word 'new' before 'Properties' and 'GradleException' and in both files the Studio error messages were removed.
For me just deleting new before Properties and GradleException it have solved it.
• Flutter version 1.21.0-10.0.pre.55 | Master Channel |
• Dart version 2.10.0 (build 2.10.0-11.0.dev)
• Android Studio 4.0.1
here is first lines in build.gradle 'contains changes'
def localProperties = Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
. . . . . . . .