The AGP 9 problem, and the workaround
01 Sept 2026 · Field Track 360
trackit-core pulls androidx.core 1.19.0, whose AAR metadata demands AGP 9.1 or higher. Flutter's Gradle plugin (through 3.38) cannot run under AGP 9 - it throws an NPE, because AGP 9 ships Kotlin support built in while Flutter still expects org.jetbrains.kotlin.android to be applied separately.
Forcing androidx.core down breaks the tie, and it is safe rather than merely convenient: the only androidx.core APIs the SDK touches are NotificationCompat, ServiceCompat, ContextCompat and the three Location*Compat classes, all stable since core 1.7.
``` allprojects { repositories { google() mavenCentral() maven(url = "https://jitpack.io") { credentials { username = trackitAuthToken } } }
// Remove when Flutter supports AGP 9. configurations.configureEach { resolutionStrategy.force( "androidx.core:core:1.16.0", "androidx.core:core-ktx:1.16.0", ) } } ```
Note this belongs in android/build.gradle.kts, not settings.gradle.kts: Flutter declares project-level repositories on :app, and Gradle ignores dependencyResolutionManagement for any project that does.
The real fixes are a Flutter release whose Gradle plugin supports AGP 9, or the SDK lowering its androidx floor. Delete the pin when either lands.