Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

Android Gradle build in a Flutter app cannot find the Flutter SDK

Errorflutter.sdk not set in local.properties

Short answer

The Android build reads the Flutter SDK path from the flutter.sdk key in android/local.properties. If that key is missing, Gradle stops with an assertion or a GradleException. Add the key with your SDK path. If the error comes from old template code, migrate the android folder to the plugin loader. In Kotlin scripts, import java.util.Properties.

  • Applies to Flutter 3.35, Gradle 8.x, Android Gradle Plugin 8.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open android/local.properties and look for the flutter.sdk line. Gradle reads that file; Flutter's template does not hard-code the path.

    cat android/local.properties
  2. 2Match what you see, then jump to its fix

    1. 1flutter.sdk not set in local.propertiesflutter.sdk is missing from android/local.propertiesFix
    2. 2GradleException: Flutter SDK not found. Define location with flutter.sdk in the local.properties file.The android folder still uses the old imperative templateFix
    3. 3The IDE marks Properties in a .kts file as an unresolved symbolProperties is not found in a Kotlin script or helper fileFix

What does the error look like?

  • flutter.sdk not set in local.properties
  • GradleException: Flutter SDK not found. Define location with flutter.sdk in the local.properties file.
  • cannot resolve symbol Properties

Cause 1 of 3

flutter.sdk is missing from android/local.properties

1Check

The template settings.gradle loads local.properties, reads flutter.sdk and asserts that it is not null. An empty file, a copied project or a file from another machine fails that assertion.

ls -l android/local.properties
grep -n "flutter.sdk" android/local.properties

2Fix

Add the key with the path to your Flutter SDK folder (the folder that contains bin), then run the build again.

# android/local.properties
flutter.sdk=/Users/me/develop/flutter

3Verify

Run a build from the project root.

flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

Cause 2 of 3

The android folder still uses the old imperative template

1Check

That GradleException comes from the legacy android/app/build.gradle, which also applies Flutter's Gradle script with apply from. Flutter's migration guide lists those lines as the ones to remove.

grep -n "GradleException\|apply from\|apply plugin" android/app/build.gradle

2Fix

Follow the migration guide: put the flutter.sdk lookup in settings.gradle inside pluginManagement, include the plugin loader, and replace the apply lines in app/build.gradle with the plugins block.

// android/app/build.gradle (top of file)
plugins {
    id "com.android.application"
    id "kotlin-android"
    id "dev.flutter.flutter-gradle-plugin"
}

3Verify

Run the build; the legacy exception no longer appears.

flutter build apk --debug

Confirmed by docs.flutter.dev

Did this fix it?

Cause 3 of 3

Properties is not found in a Kotlin script or helper file

1Check

Properties is java.util.Properties. Flutter's Groovy settings.gradle uses it without an import, but the Kotlin DSL documents its implicit imports and java.util.Properties is not in that list.

grep -rn "Properties()" android/*.kts android/app/*.kts

2Fix

Add the import at the very top of the .kts file.

import java.util.Properties

val localProperties = Properties()
file("local.properties").inputStream().use { localProperties.load(it) }

3Verify

Sync Gradle or run the build again.

cd android && ./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Do not commit android/local.properties; it is machine specific. Let each machine create its own.
  • After moving or reinstalling the SDK, update flutter.sdk in the same step.
  • Keep the android folder on the current Flutter template instead of editing the old one by hand.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Mobile apps

Google Play says the app does not support 16 KB memory pages

check_elf_alignment.sh reports UNALIGNED for a library under lib/arm64-v8a

Google Play requires apps that target Android 15 or higher and ship native .so libraries to run on devices with 16 KB memory pages; from 1 February 2027 it will block updates that do not.

5 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.