Android Gradle build in a Flutter app cannot find the Flutter SDK
flutter.sdk not set in local.propertiesShort 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.
Fix it fast
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.properties2Match what you see, then jump to its fix
- 1
flutter.sdk not set in local.propertiesflutter.sdk is missing from android/local.propertiesFix - 2
GradleException: Flutter SDK not found. Define location with flutter.sdk in the local.properties file.The android folder still uses the old imperative templateFix - 3
The IDE marks Properties in a .kts file as an unresolved symbolProperties is not found in a Kotlin script or helper fileFix
- 1
What does the error look like?
flutter.sdk not set in local.propertiesGradleException: 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.properties2Fix
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/flutter3Verify
Run a build from the project root.
flutter build apk --debugConfirmed by docs.flutter.dev
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.gradle2Fix
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 --debugConfirmed by docs.flutter.dev
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/*.kts2Fix
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 helpConfirmed by docs.gradle.org
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
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 fixMobile apps
Gradle cannot find com.google.firebase:firebase-analytics-ktx
Required by: project :app
Firebase moved the Kotlin extensions into the main modules and stopped releasing the -ktx modules in July 2025.
2 causes, each with a fixMobile apps
Gradle cannot create LibraryVariantBuilderImpl in a Flutter Android build
Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl
This error appears when the Android Gradle plugin (AGP) cannot run in the Gradle or IDE you use.
3 causes, each with a fixMobile apps
Flutter release build cannot open the keystore: HmacPBESHA256 not available
Algorithm HmacPBESHA256 not available
The keystore is a PKCS12 file protected by a newer algorithm than the Java that is reading it understands.
3 causes, each with a fixMobile apps
Android install error: the package conflicts with an existing package of the same name
The package conflicts with an existing package by the same name
Android allows only one app per application ID, and an update must be signed with the same certificate as the installed version.
3 causes, each with a fixMobile apps
Android resource linking fails with resource android:attr/lStar not found
error: failed linking references.
The lStar attribute exists only from Android API 31.
2 causes, each with a fix