First Flutter App error: cannot resolve symbol “Properties”

前端 未结 13 2367
南旧
南旧 2020-12-29 04:46

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

13条回答
  •  无人及你
    2020-12-29 05:24

    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.")
    }
    

    . . . . . . . .

提交回复
热议问题