AndroidStudio: Could not find com.android.tools.build:gradle:8.9.0

What is the recommended process for upgrading Gradle in a Flutter / Android Studio project ?

I have an otherwise stable Flutter app in development that works great in Android Studio 2024.1.1 (Android/iOS/Web) but if I upgrade Android Studio to 2024.2.1 (Lady Bug) no longer compiles with various gradle errors that I’ve been chasing for a few days now.

Most recently, I ran this command to upgrade gradle in the …/android directory:
./gradlew wrapper --gradle-version=8.9.0

… and now when I try to compile to android I see

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:8.9.0.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom
     Required by:
         project :

* 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 https://help.gradle.org.

BUILD FAILED in 5s
Error: Gradle task assembleDebug failed with exit code 1

Looking for a version that would work, I tried brute-forcing version #s at https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/8.9.0/gradle-8.9.0.pom, matching any pattern of 8.[0-10].[0-10] and the most recent one that this link has is 8.7.0.

In the older IDE, ./gradlew --version reports 7.5.

You mix up Gradle versions with Android Gradle Plugin versions, and even version schemas.

There is no Gradle version 8.9.0 and there will never be, because there is 8.9.
So if you would have successfully executed ./gradlew wrapper --gradle-version=8.9.0, that would have caused that you would not be able to do any ./gradlew command after that at all as it would fail to find that Gradle distribution anywhere.

There will be an Android Gradle Version 8.9.0 probably, but only as version after next version, the current one is 8.7.1 and the upcoming one 8.8.0.
Unfortunately Google had the very bad idea to call their artifact gradle, but the version coming after com.android.tools.build:gradle: has nothing to do with Gradle, it is the verision of the Android Gradle plugin.

And your error message is telling you that you tried to use Android Gradle Plugin 8.9.0 which is not found as it does not exist.