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.