:app:compileDebugJavaWithJavac' error on new project, sqflite error after switching to SDK 35
22:27 20 Jul 2026

Setup: Flutter 3.44.4, Windows 11, Android Studio's bundled JDK 21, testing on a physical device.

So the first thing, when creating a new project, if I try to run it I get this error:

[  +96 ms] FAILURE: Build failed with an exception.
[   +3 ms] * What went wrong:
[        ] Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
[   +1 ms] > Cannot query the value of this provider because it has no value available.
[        ] * Try:
[        ] > Run with --debug option to get more log output.
[        ] > Run with --scan to generate a Build Scan (Powered by Develocity).
[        ] > Get more help at https://help.gradle.org.
[   +1 ms] * Exception is:
[        ] org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task
':app:compileDebugJavaWithJavac'.
[        ]      at
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.
java:70)
[   +1 ms]      at org.gradle.execution.plan.TaskDependencyResolver.resolveDependenciesFor(TaskDependencyResolver.java:49)
[        ]      at org.gradle.execution.plan.LocalTaskNode.getDependencies(LocalTaskNode.java:151)
[        ]      at org.gradle.execution.plan.LocalTaskNode.resolveDependencies(LocalTaskNode.java:125)
[        ]      at org.gradle.execution.plan.DefaultExecutionPlan.discoverNodeRelationships(DefaultExecutionPlan.java:182)

to fix this I needed to change the target sdk to 35 for it to work. next if I try to add sqflite or path I get a different error when I try to run flutter, this one says:


[   +1 ms] Your project is configured to compile against Android SDK 35, but the following plugin(s)
require to be compiled against a higher Android SDK version:
[   +2 ms] - sqflite_android compiles against Android SDK 36
[        ] Fix this issue by compiling against the highest Android SDK version (they are backward
compatible).
[        ] Add the following to C:\Users\Anthony
Ian\Desktop\AndroidProject\test8\android\app\build.gradle.kts:
[   +1 ms]     android {
[        ]         compileSdk = 36
[        ]         ...
[        ]     }
[ +491 ms] w: Deprecated 'org.jetbrains.kotlin.android' plugin usage
[   +1 ms] The 'org.jetbrains.kotlin.android' plugin in project ':sqflite_android' is no longer
required for Kotlin support since AGP 9.0.
[   +1 ms] Solution:
[        ] Remove both `android.builtInKotlin=true` and `android.newDsl=false` from
`gradle.properties`, then migrate to built-in Kotlin.
[        ] See https://kotl.in/gradle/agp-built-in-kotlin for more details.
[   +1 ms] All projects evaluated.
[  +85 ms] Task name matched 'assembleDebug'
[   +1 ms] Selected primary task 'assembleDebug' from project :
[ +109 ms] Adding -Xuse-inline-scopes-numbers Kotlin compiler flag for task :app:compileDebugKotlin
[ +497 ms] Build 4159eb20-b5e3-4306-843a-62dd2bd0aa12 is closed
[  +93 ms] Build 98aad15d-811c-48ee-87ae-f91dde287eea is closed
[        ] [Incubating] Problems report is available at:
file:///C:/Users/Anthony%20Ian/Desktop/AndroidProject/test8/build/reports/problems/problems-report.ht
ml
[   +1 ms] FAILURE: Build failed with an exception.
[   +1 ms] * What went wrong:
[   +1 ms] Could not determine the dependencies of task ':sqflite_android:compileDebugJavaWithJavac'.
[   +1 ms] > Cannot query the value of this provider because it has no value available.
[        ] * Try:
[        ] > Run with --debug option to get more log output.
[        ] > Run with --scan to generate a Build Scan (Powered by Develocity).
[        ] > Get more help at https://help.gradle.org.
[        ] * Exception is:
[   +1 ms] org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the
dependencies of task ':sqflite_android:compileDebugJavaWithJavac'.
[   +1 ms]      at
org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependen
cyResolveContext.java:70)
[        ]      at
org.gradle.execution.plan.TaskDependencyResolver.resolveDependenciesFor(TaskDependencyResolver.java:4
9)
[        ]      at org.gradle.execution.plan.LocalTaskNode.getDependencies(LocalTaskNode.java:151)
[   +1 ms]      at org.gradle.execution.plan.LocalTaskNode.resolveDependencies(LocalTaskNode.java:125)

so I bump the target sdk up to 36, and that's when the first error comes right back, the "cannot query the value of this provider" one. so now I'm stuck between the two, sdk 35 works but breaks sqflite, sdk 36 fixes sqflite but breaks the build again. I tried downgrading flutter to 3.44.1 and also downgrading/patching sqflite but it still didn't work.

I tried changing the AGP version (tried 8.7.2, 8.11.1, and the default 9.0.1), changed Gradle version too (8.9 and 9.1), and even switched the JDK from Android Studio's bundled JDK 21 to Temurin JDK 17. none of that worked either, same error every time once I'm on sdk 36.

now I'm wondering if it's something else entirely, like a broken SDK install (I have both an android-36 and a weird android-36.1 folder in my SDK platforms, not sure if that's normal) or maybe my project path having a space in it since my Windows username has a space. haven't tried reinstalling the SDK or moving the project to a path without spaces yet.

has anyone run into this exact error before? would really appreciate any help at this point.

this is my flutter doctor:


PS C:\Users\Anthony Ian\Desktop\AndroidProject\test8> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.44.5, on Microsoft Windows [Version 10.0.26200.8875], locale en-US)
[√] Windows Version (Windows 11 or higher, 25H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
    X Android SDK location currently contains spaces, which is not supported by the Android SDK as it
      causes problems with NDK tools. Try moving it from C:\Users\Anthony
      Ian\AppData\Local\Android\Sdk to a path without spaces.
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default
      components
[√] Connected device (5 available)
[√] Network resources

! Doctor found issues in 2 categories.

build.gradle.kts:


plugins {
    id("com.android.application")
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id("dev.flutter.flutter-gradle-plugin")
}

android {
    namespace = "com.example.test8"
    compileSdk = flutter.compileSdkVersion
    ndkVersion = flutter.ndkVersion

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "com.example.test8"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        minSdk = flutter.minSdkVersion
        targetSdk = flutter.targetSdkVersion
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig = signingConfigs.getByName("debug")
        }
    }
}

kotlin {
    compilerOptions {
        jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
    }
}

flutter {
    source = "../.."
}

settings.gradle.kts:

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 "9.0.1" apply false
    id("org.jetbrains.kotlin.android") version "2.3.20" apply false
}

include(":app")

flutter sqflite