firebase_ai Flutter plugin fails with "Cannot query the value of this provider because it has no value available" on Gradle 9.1.0
I'm getting a build failure specifically in the firebase_ai plugin's Android build task when running flutter run / flutter build apk. Other Firebase plugins in the same project (firebase_auth, firebase_core) build fine — the failure is isolated to firebase_ai
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':firebase_ai:compileDebugJavaWithJavac'.
> Cannot query the value of this provider because it has no value available.
Flutter: sdk: ^3.12.2
Gradle wrapper: 9.1.0 (distributionUrl=...gradle-9.1.0-all.zip)
Relevant pubspec.yaml dependencies:
firebase_core: ^4.10.0
firebase_auth: ^6.5.2
firebase_ai: ^3.13.1
I tried downgrading the Gradle version, but I still get the same error. I'm running the project via VSCode.