简体   繁体   中英

Why does build.gradle file showing error for "Properties" class?

I am new to flutter developing. Recently I was learning to connect firebase with flutter but facing some problem. Here in the app gradle file, this "Properties" class is not found. But this was even given in the file I haven't touched anything. Cannot find any solution. Hope I could get ea solution here!

def localProperties = new Properties()

if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

Faced a similar issue and it turned out to be a missing/unconfigured sdk:

You might be missing a jdk in your project settings:

Do the following:

In Android Studio: Go to File > Open Project Structure .Then in the SDk section if your sdk looks like this:

缺少 SDK

Select the drop down icon and if you installed your jdk and sdk properly in the initial stages of setting up your android studio, you will find options for your sdk or jdk. If you are not sure which option to select, there is a download option in the list of options in the dropdown.

SDK/JDK 选项

If this does not solve your issue:

The second solution is to remove the "new" keyword before properties.

***NB:This could break your app.***

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