I have been stuck on this error for a while now while working on my flutter app, and there have been no open threads on Stack overflow that answer this question yet. The project works fine from Android studio but crashes with errors as soon as I run it from VS Code. The iOS version of the app works perfectly well. I am using gradle version 8.11.1 and plugin version 8.9 and Kotlin's version 2.1.0 as per Google official documentation. I have tried various different gradle versions, gradle cache resets, checked my flutter installation directory path in local.properties
and yet the same issue, I have also tried resetting the entire android folder to eventually run into the same issue again:
Here is the error: FAILURE: Build failed with an exception.
Where: Settings file '/Users/MyComputerName/Documents/Development/myappname/android/settings.gradle.kts' line: 19
What went wrong: Error resolving plugin [id: 'dev.flutter.flutter-plugin-loader']
A problem occurred configuring project ':gradle'. Could not read workspace metadata from /Users/MyComputerName/.gradle/caches/8.11.1/kotlin-dsl/accessors/30f9c140246fd78ff49d74be3a7b57e2/metadata.bin
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at .
BUILD FAILED in 24s Running Gradle task 'assembleDebug'... 24.5s Error: Gradle task assembleDebug failed with exit code 1
Here is my settings.gradle.kts
file:
pluginManagement {
val flutterSdkPath = run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.9.0" apply false
id(".jetbrains.kotlin.android") version "2.1.0" apply false
}
include(":app")