All posts

Coming Back to Flutter: When the Code Isn't the Problem.

Returning to Flutter meant more than refreshing Dart. Upgrading an existing Android project brought Gradle, the Android Gradle Plugin, Kotlin, the JDK and plugin compatibility into the picture.

10 min read

Coming back to Flutter after a long break, I expected to spend most of my time refreshing my Dart knowledge, revisiting widgets and state management, and getting comfortable building mobile apps again.

Those things were part of the process. But I quickly learned that a lot of the work involved in getting a Flutter app running on Android happens outside Flutter and Dart.

Between the code and a running app sit Gradle, the Android Gradle Plugin (AGP), Kotlin, the JDK, Android Studio and every third-party package the project depends on. Each has its own versions, compatibility requirements and migration paths. You can have perfectly reasonable Dart code and still be unable to build the application because one part of the Android toolchain no longer agrees with another.

I experienced that first-hand while bringing an existing project up to date. I ran into the different parts of the upgrade process rather than one isolated issue: Gradle and AGP configuration, Kotlin-related changes, JDK requirements, plugin compatibility, Android project configuration and dependency updates. It was a reminder that an upgrade can turn into a chain of problems, where fixing one incompatibility exposes the next.

This post reflects the Flutter 3.50 release and the tooling landscape as of November 2026. Version requirements change, so check the official migration guides and release notes before applying these steps to your own project.

The discussion that caught my attention

While exploring the Flutter developer community, I came across a Reddit discussion titled Anyone else experiencing the Flutter/Gradle upgrade hell?. The discussion describes a familiar kind of frustration: upgrading Flutter and the surrounding Android development environment can leave an existing project dealing with warnings and compatibility problems, even when the application code itself has not changed much.

The useful takeaway is not that every upgrade will be painful, or that there is one universally correct upgrade strategy. Developers have different approaches. Some prefer to keep dependencies and tooling current so that changes remain manageable; others prefer to wait until a new release has had time to settle.

One practical approach discussed in the community is to create a clean project, add dependencies gradually, confirm that each step builds, and then migrate the application code. That can help separate problems caused by an old Android project configuration from problems introduced by a package or by the application itself.

The discussion resonated with me because it reflected what I had just experienced: the difficult part is often not identifying that the build has failed, but finding which part of the toolchain or dependency chain caused it.

It's more than just Flutter and Dart

When you build a Flutter app for Android, several technologies work together behind the scenes. A simplified breakdown:

  • Flutter SDK: Provides the framework, widgets, rendering system and development tools.
  • Dart SDK: The programming language and development tooling used by Flutter applications.
  • Gradle: The build automation system that orchestrates the Android build.
  • Android Gradle Plugin (AGP): Connects Android-specific build tasks and configuration to Gradle.
  • Kotlin: Used in Android development and by many Flutter plugins that include native Android code.
  • JDK: Provides the Java runtime and tools required by the Android build process.
  • Third-party packages: Extend the application and may bring their own native Android code and build configuration.

These components are connected, and their compatibility requirements change over time. Upgrading AGP may require a newer Gradle version, while the Android build tools may require a particular JDK version. Flutter plugins can introduce another layer because they may depend on Android build conventions that have changed.

For example, Flutter 3.50's Android project defaults use AGP 9.3.1 and Gradle 9.5.0, with Java 17 or newer required. Those versions are not a universal instruction to replace the configuration in every existing project; they are a reminder to check the compatibility requirements for the specific versions being used.

The result is a dependency chain where a change in one place can surface as an error somewhere else, often with little connection to the Dart code you were working on.

When the Android build system changes

One of the significant recent changes is built-in Kotlin support in Android Gradle Plugin 9. Android projects traditionally applied a separate Kotlin Gradle Plugin (KGP) to compile Kotlin. With AGP 9, Kotlin support is built into the Android Gradle Plugin, reducing the need for that separate plugin in supported project configurations.

The transition is not automatically straightforward for every existing project. An application or one of its Flutter plugins may still apply the old Kotlin Gradle Plugin. If the project and its dependencies have not moved to the new setup together, changing the build configuration can break the build. It is not simply a matter of changing one version number.

Flutter has supported this transition across several releases:

  • Flutter 3.44 added temporary support for the legacy KGP setup on AGP 9 through android.builtInKotlin=false, giving apps and plugins time to migrate. The same release made Swift Package Manager the default for iOS and macOS projects.
  • Flutter 3.47 added support for enabling built-in Kotlin with android.builtInKotlin=true, once the app and its plugins are ready for it. It should not be enabled blindly: a dependency that still applies KGP can cause build problems.
  • Flutter 3.50 continued the migration path. Its release notes explain that plugins still applying KGP manually will receive lower pub.dev scores in the future and will fail to build under AGP 10.

There is an important caveat in Flutter's migration guide: the migration applies to projects that already use KGP. If your project does not use it, you do not need to carry out that migration just because the guide exists.

The lesson for an existing project is to understand its current setup before changing it. A configuration that is correct for a newly created project may not be a drop-in replacement for an older one with a different set of plugins.

Not all upgrade pain is in the toolchain

Flutter 3.50, released with Dart 3.14, is also a reminder that some changes affect application code rather than the Android build environment.

The standalone material_ui and cupertino_ui packages reached version 1.0 in Flutter 3.47. In Flutter 3.50, the bundled material.dart and cupertino.dart imports were formally deprecated, and the standalone packages became the default for new projects. Existing projects can use Dart's automated fixes to help migrate:

dart fix --apply --code=migrate_design_widgets

Android release builds also became stricter: entrypoint-related values are ignored, and engine flags passed through Intent extras from other apps are rejected to address a security issue.

These changes are different from a Gradle or Kotlin compatibility failure. They affect other parts of the development process, which is why it is useful to read the release notes instead of assuming every upgrade issue has the same cause.

None of this is a reason to avoid upgrading. Many of these changes are improvements intended to make the framework and its surrounding ecosystem easier to maintain. But keeping an existing project current takes more than bumping the Flutter SDK version.

Why upgrading everything at once becomes a problem

When several parts of the environment change together, debugging becomes much harder. If the Flutter SDK, Android Studio, AGP, Gradle, Kotlin configuration and third-party packages are all updated in one go, any of them could be responsible for a new failure.

That was the difficult part of my own upgrade experience. I had to deal with the different layers rather than a single isolated error. The Android build configuration, tool versions and dependencies all needed attention. It reinforced how easy it is to lose track of the original cause when multiple changes are introduced at the same time.

A more controlled approach is to treat an upgrade as an engineering task with its own plan:

  1. Commit the working project. Make sure there is a clean Git baseline to return to.
  2. Record the current environment. Run flutter doctor -v and note the Flutter, Dart and Java versions. Check the Gradle and AGP versions in the Android build files.
  3. Read the migration notes. Check the Flutter release notes and the Android compatibility requirements before changing versions.
  4. Upgrade in manageable steps. Avoid changing every part of the toolchain and every dependency simultaneously.
  5. Check plugins individually when needed. Pay attention to packages that include native Android code or apply their own Gradle plugins.
  6. Build and test after each significant change. Confirm that the project compiles and that important application workflows still work.

Another option is to create a fresh Flutter project and migrate dependencies and application code across gradually. This can be useful when an older project has accumulated legacy Android configuration, although it also requires careful testing. Neither approach is a universal fix. The important thing is to make changes in a way that helps you identify what caused a problem.

The problem isn't necessarily Flutter

It would be easy to read upgrade discussions and conclude that Flutter itself has become difficult to work with. The broader picture is more balanced.

In the Q2 2026 Flutter developer survey, fielded in June 2026, the Flutter team collected more than 3,500 responses. The survey reported 93% positive overall satisfaction. Dart scored 92%, Android app development 91% and the core framework 90%.

The survey also identified platform and ecosystem maturity as the largest theme in dissatisfaction feedback, with upgrade pain a recurring concern. Developers described spending time matching versions of Flutter, Dart, Gradle, Kotlin and the JVM when upgrading older Android projects.

The Flutter team has also made changes across recent releases to address parts of this experience:

  • Flutter 3.29 moved away from legacy script-based Gradle plugin applications.
  • Flutter 3.32 rewrote the Flutter Gradle plugin from Groovy to Kotlin.
  • Flutter 3.38 published an official Android build-tool compatibility matrix.
  • Flutter 3.41 added AGP 9 support.
  • Flutter 3.44 introduced the built-in Kotlin migration path.

So the framework itself continues to receive strong satisfaction ratings, while the surrounding platform and tooling ecosystem remains a source of friction for some developers. That distinction matters. A build-system migration problem does not automatically mean the framework is a poor choice; it means the full development environment needs to be understood and maintained.

What I'm taking away

My recent return to Flutter has been a practical lesson in how connected the Android toolchain is. I had to deal with Gradle and AGP configuration, Kotlin-related changes, JDK requirements, Android project settings and dependency compatibility during the upgrade. It was not one neat error with one obvious fix. Each layer had to be understood in the context of the others.

That experience changed how I approach an existing project. Before making an upgrade, I want to know what versions it currently uses, which plugins depend on native Android tooling, and what the official migration path expects. I also want a working Git baseline so that I can make changes deliberately and identify regressions.

I'm currently working on a business application involving sales-officer authentication, token-based sessions, API integration, application state, stock information, customer details and order creation. In that kind of application, getting the feature working is only part of the job. The project also needs to build reliably, its dependencies need to remain compatible, and the development environment needs to be maintainable.

A few practices now stand out to me:

  • Understand the versions and dependencies your project currently uses.
  • Read migration guides before making major upgrades.
  • Avoid changing multiple parts of the build environment without a reason.
  • Keep a working Git baseline before significant changes.
  • Treat warnings and errors differently, but understand what each warning is telling you.
  • Remember that third-party dependencies are part of your application's long-term maintenance responsibility.

I don't think you need to chase every release. But avoiding upgrades indefinitely is not a good strategy either. The goal is to understand when an upgrade is necessary, what it changes, and how to introduce it without putting a working application at unnecessary risk.

Final thoughts

Writing application code is only one part of software engineering. Building an application, integrating its dependencies, managing the development environment and keeping everything working together are all part of the same job.

You might spend hours implementing a feature, only to find that a change in the build system stops the app from compiling. Sometimes the most useful skill is not writing another line of code. It is understanding why the code you already have can no longer be built.

Maintaining an application isn't just about maintaining its code. It's also about understanding everything that allows that code to work.

Further reading

  1. Flutter/Gradle upgrade discussion on r/FlutterDev
  2. Flutter Q2 2026 developer survey
  3. What's new in Flutter 3.44
  4. What's new in Flutter 3.50
  5. Flutter breaking changes and migration guides
  6. Migrating Flutter Android projects to built-in Kotlin
  7. Android: Migrating to built-in Kotlin