One of my biggest issues with Flutter development is if you let your project sit for a while and come back to it, you have to spend forever trying to get it to run again. Flutter upgrades, but the configuration in the projects don’t and become incompatible. Getting the configuration upgraded to match proves difficult.
I feel like things are getting better and there are better tools, but it is still a challenge. This article is what I have discovered so far. It’s just a few ideas of things you can check.
At the time of this writing, I’m using Android Studio Ladybug (2024.2.2)

What is Gradle?
Gradle is the tool that Flutter uses behind the scenes to build and create the program itself. Gradle is to Flutter as Ant is to Java. Gradle is Flutter as Makefiles are to C and C++. The website describes it as:
Gradle is the open source build system of choice for Java, Android, and Kotlin developers. From mobile apps to microservices, from small startups to big enterprises, it helps teams deliver better software, faster.
Android Directory
The Android directory in a Flutter project is the structure for building the mobile output for an Android device. Here are the main files that you will need to edit:
- android/settings.gradle.kts
- android/build.gradle
- android/app/build.gradle
Android Studio has some special tools for working with the Gradle. To use these, you need to open the directory. File > Open, then choose the “android” directory underneath your Flutter directory.

Once that directory is open, you can now use the AGP Upgrade Assistant. It is located at Tools > AGP Upgrade Assistant. Just as a reminder, it will be disabled and grayed out until the android directory is the top-level directory open in Android Studio at the moment. Also, important: make sure that you have committed all of your changes to the Git repository. It will fail if changes are outstanding.
Settings.Gradle
One of the problems I had was that my settings.gradle file was outdated. I need to update it. Here’s my new update:
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 "8.7.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
}
include(":app")
First, the newer Flutter projects seem to use the Kotlin version. So, your file should be called settings.gradle.kts rather than just settings.gradle.
Then, to get the most updated contents that Flutter is expecting, create a new Flutter project in a temporary directory:
cd ~/tmp
flutter create temp
cd temp
cd android
ls settings.gradle*
Setting the Gradle Version
You can change the Gradle Version in Android Studio with the Project Structure dialog. Again, make sure that the android directory is open in Adnroid Studio as the top-level folder/project. Then, choose File > Project Structure.

Then, it is important to make sure that your settings.gradle file has the matching version. The id(“com.android.application”) line needs to have the Gradle Plugin ersion.
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "***AGP Version***" apply false
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
}
The important part is that this isn’t the Gradle version. The plugin is different and version differently. So far, the best resource is the chart on the Release Notes page.
Signing Issues
Some of my issues were related to the app signing. When I redid my android/app/build.gradle.kts file, I broke the signing properties. So, here’s a reference to help with fixing that.
Build and release an Android app
Building a New App
When all else fails, you can recreate the app in a new directory. Not rewrite it, but just regenerate the project and move the code over. Rename your current directory, maybe add a “-old” on the end. Then, create a new project with your original name.
flutter create newproject
cd newproject
flutter run
This should run. If not, you probably have an issue with your flutter installation. Then, make sure it will build an apk.
flutter build apk
Again, if this doesn’t work, you probably have an issue with your flutter installation. Now, copy over the info from the pubspec.yaml. You should probably start with the dependencies. Copy them over and then try to run again.
flutter pub get
flutter run
flutter build apk
If you run into issues here, it means that you have an issues with dependencies. You could try moving over one at a time and see at what point it starts to break. On the other hand, if this still works, you can copy over the code.