Today I Learned: After Upgrading to Flutter 3.29.0
Flutter 3.29 has just been released, and after I updated it, our app failed to build.
Flutter showed errors like “cannot find symbol” and failed to compile.
After spending an entire day investigating — clearing the cache, changing the Java version, clearing Gradle, and clearing the pub cache — I finally found the issue.
The API
import io.flutter.plugin.common.PluginRegistry.Registrar
has been removed, but Flutter failed to mention in the breaking changes that V1 embedding would be removed.
As a result, many libraries that still rely on this import are now broken. We had to manually pull those dependencies, remove this import, and modify some code related to PluginRegistry.Registrar.
If you’ve encountered this issue, actively maintained libraries will likely push fixes soon. However, for abandoned libraries, this is a critical problem — especially for teams that need to upgrade to Flutter 3.29.0 quickly.
So, what we need to do is fork these inactive libraries, remove the imports from the V1 embedding, and in some cases, add our own code to fix them.
Moreover, We have to change a lot of things such as:
- gradle-wrapper.properties from 8.3 to 8.10.2 — a significant jump from Flutter 3.27.
- Since moving from Gradle 7.x to 8.x, many libraries require workarounds. Here’s my code in build.gradle:
subprojects {
// Workaround for override compileSdkVersion
// And force to use Java 17
afterEvaluate { project ->
if (project.hasProperty('android')) {
android {
compileSdkVersion 35
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
}
}
// Workaround for add namespace for android library for using Gradle 8+
if (project.plugins.hasPlugin('com.android.library')) {
android {
defaultConfig {
def androidManifest = android.sourceSets.main.manifest.srcFile
if (androidManifest.exists()) {
def parsedManifest = new XmlParser().parse(androidManifest)
def packageName = parsedManifest.attribute('package')
if (packageName) {
namespace = packageName
} else {
namespace = "com.kbtg.neobank.${project.name}"
}
}
}
}
}
}
project.evaluationDependsOn(':app')
}
3. There’s also a big jump in settings.gradle that needs adjustments.
id "com.android.application" version "8.7.0" apply false
id 'org.jetbrains.kotlin.android' version '2.0.21' apply false
I had to upgrade from Kotlin 1.9.22 (used in Flutter 3.27) to Kotlin 2.0.21 for Flutter 3.29. They mentioned that a newer Kotlin version was required in Flutter Fix, but nothing worked until I updated to this version.
4. in build.gradle (app), I had to add a specific line to make it work with Kotlin 2.0+, which needs to be added under plugins.
id "org.jetbrains.kotlin.plugin.compose" version "2.0.21"
In my opinion, it would be helpful if Flutter avoided removing breaking changes especially after the challenges in the previous release (PowerVR Renderer). Or perhaps they simply forgot to mention it since this API had been deprecated for a long time. Hopefully, this can be improved in future updates to make transitions smoother for developers 😢
Follow more on Flutter Mekong — where we share real-world experiences so that no one has to repeat the same mistakes.