Repository navigation
[Android] Add Flutter 3.50 breaking-change page for the Flutter Gradle Plugin Variant API migration - #14053
[Android] Add Flutter 3.50 breaking-change page for the Flutter Gradle Plugin Variant API migration#14053reidbaker-agent wants to merge 30 commits into
Conversation
Adds two breaking-change pages for the Flutter 3.50 stable release and lists them in the index: - Raised minimum Android build tool versions: AGP 9.1.1, Gradle 9.3.1, KGP 2.4.10 (when applied), AGP 10 unsupported, and how built-in Kotlin and the new AGP DSL properties interact with the upgrade. - Flutter Gradle Plugin uses the Android Gradle Plugin Variant API: user-visible behavior changes from migrating the Flutter Gradle Plugin to public AGP APIs (APK copy task, per-ABI versionCode, custom build types, assets, add-to-app, flutter build aar) and a migration guide for legacy applicationVariants usage. Fixes flutter/flutter#193713 (publishes the website-page-draft).
- Call out that projects created with Flutter 3.44/3.47 templates (AGP 9.0.1/9.1.0, KGP 2.3.20/2.4.0) are below the new minimums. - Correct the AGP error message sample and the AGP 10 message. - Clarify when the KGP check applies (Flutter auto-applies KGP when android.builtInKotlin=false), and that checks run before the plugin reads the Android DSL rather than 'before anything else'. - Fix apkanalyzer command (manifest version-code). - Describe the 3.50 migrator behavior for android.newDsl accurately and document opting in with android.newDsl=true + android.builtInKotlin=true. - Note finalizeDsl ordering for versionCode and where the flutter.hostAppProjectName warning is visible.
|
@reidbaker, should this be in draft? Let me know if we should get this moving... |
Yes it should be until I review it and say it is ready for human (non agent) eyes. |
- Apply plain-language and flutter/website style conventions across both
3.50 Android build breaking-change pages (imperative task headings,
explicit affected vs unaffected triage, `-` list markers, no manual
table footnotes or inflected code spans, and semantic line breaks).
- Fix technical findings verified against Flutter 3.50.0:
- Clarify how to inspect current AGP/Gradle/KGP/JDK versions and what
`flutter analyze --suggestions` actually reports.
- Complete the trimmed AGP error message, add 3.44 template Gradle
9.1.0 and Gradle/KGP no-advance-warning ranges, and fix the broken
AGP/Gradle compatibility table anchor (`about-agp#updating-gradle`).
- Clarify that KGP still must be >= 2.4.10 when `builtInKotlin=false`.
- Fix `copyFlutterApks<Variant>` visibility (`./gradlew tasks --all`),
3.47 library plugin build-type copying, softened `LibraryBuildType`
debuggability note, `onVariants` task lookup (`tasks.matching`),
preview `compileSdk` comparison, `flutter run`/`flutter build`
migrator scope, Timeline pre-release versions, and master PR links.
- Replace `[-<abi>][-<flavor>]` inline code notation that triggered
`dash_site check-link-references` failures.
- Add dedicated split-per-ABI `versionCode` migration guidance and the
`-P force-version-code-ignoring-abi=true` escape hatch, with explicit
`TODO(reidbaker)` blocks for the undecided `flutter/flutter#196561`
`3.50.x` cherry-pick.
reidbaker
left a comment
There was a problem hiding this comment.
High level feedback. Sort the information based one value to the reader and remove information that users do not need to know or take action on.
Information about the migration that is not relevant to flutter app developers distracts from the information we want them to pay attention to.
| `TODO(reidbaker)`: confirm the cherry-picks landed and fill in the `3.50.x` | ||
| versions on this page ([PR 196561][] for split-per-ABI `versionCode`; | ||
| [PR 196692][] for plugin build types). |
There was a problem hiding this comment.
We dont want to leave this todo in this pr.
There was a problem hiding this comment.
Removed the in-page TODO block and replaced the 3.50.x placeholders with Flutter 3.50.1 in 295ba7d. The cherry-pick dependencies remain tracked in the PR description while this PR stays in draft.
| [PR 196692][] for plugin build types). | ||
| ::: | ||
|
|
||
| This change has two main effects: |
There was a problem hiding this comment.
I think the concept of "this change" is weird for the flutter website. We are trying to document what impact including breaking changes happen as part of the new dsl migration and specifically the changes that need more information from 3.50.
There was a problem hiding this comment.
Rewrote the page in 295ba7d around user-visible impact in Flutter 3.50 and 3.50.1 rather than PR-centric "this change" framing, and folded the separate "Description of change" section into task-focused migration sections.
| Passing `-P force-version-code-ignoring-abi=true` still disables Flutter's | ||
| per-ABI offset completely. | ||
|
|
||
| ### App build types copied to plugins |
There was a problem hiding this comment.
This is a title that requires that readers already know what they are looking for. Try to structure the titles so that a flutter dev who does not already understand the changes can find the information they need.
There was a problem hiding this comment.
Renamed the section headings in 295ba7d around developer tasks and project configurations rather than FGP internals: "Customize version codes in Gradle build scripts", "Fix split-per-ABI version code errors", "Configure profile and custom build types", "Rename, copy, or transform APK outputs", and "Configure Flutter Gradle tasks in build scripts".
| - Flutter no longer copies `isMinifyEnabled` (which Flutter 3.47 copied). | ||
| Minifying a library plugin runs R8 with only the plugin's keep rules, | ||
| stripping plugin classes referenced by `GeneratedPluginRegistrant`, | ||
| and the app's R8 pass already shrinks plugin code. |
There was a problem hiding this comment.
this seems distracting to mention if it is not a difference from 3.47 and if there is no action devs need to take or know about.
There was a problem hiding this comment.
Removed the internal plugin build-type copying details (isMinifyEnabled, isDebuggable casts, and com.android.application initWith behavior) in 295ba7d, keeping only actionable guidance (matchingFallbacks on custom build types and upgrading to Flutter 3.50.1).
| In Flutter `3.50.0` ([PR 191606][]), FGP called `initWith(appBuildType)` on | ||
| library plugins too. | ||
| Because `initWith` copies every build type property, apps with Android plugins | ||
| failed during Gradle configuration—even for `flutter run` in debug mode—when | ||
| `profile` or a custom build type set properties that AGP rejects in libraries | ||
| ([Issue 196412][], [Issue 196696][]): |
There was a problem hiding this comment.
Lets communicate these as reasons to use 3.50.1 and describe them as issues fixed in 3.50.1.
Also we dont need to duplicate all the information that is in the bug and in the pull request. This page is for users. Share what they need to know.
There was a problem hiding this comment.
Added a "Use Flutter 3.50.1 or later" callout in Summary and trimmed "Configure profile and custom build types" in 295ba7d to present the 3.50.0 regressions as issues fixed in Flutter 3.50.1, linking the issues instead of duplicating the per-property AGP breakdown and 3.50.0 Gradle workaround.
| ### Flutter assets are a generated source directory | ||
|
|
||
| Flutter's `flutter_assets` directory is now registered on each variant as a | ||
| generated assets source directory (`addGeneratedSourceDirectory`). | ||
| Previously, Flutter copied these files into AGP's merged assets output directory | ||
| after `merge<Variant>Assets`, and `process<Variant>Resources` depended on | ||
| `flutter assemble`. | ||
| Now AGP merges `flutter_assets` in the variant overlay—taking precedence over | ||
| static `src/main/assets` unless a later `onVariants` callback registers another | ||
| assets directory—and `process<Variant>Resources` no longer waits on | ||
| `flutter assemble`. |
There was a problem hiding this comment.
Do users need to know this? if not remove it.
There was a problem hiding this comment.
Removed the "Flutter assets are a generated source directory" section in 295ba7d. Added only a brief migration note under "Configure Flutter Gradle tasks in build scripts" for scripts or tests that read build/app/intermediates/assets/<variant>/merge<Variant>Assets/flutter_assets/ (which changed in 3.50.1 via flutter/flutter#196465 and should read packaged assets from the built APK or AAB instead).
| uploading the set to Google Play. | ||
| ::: | ||
|
|
||
| ### Set per-ABI or per-variant `versionCode` values |
There was a problem hiding this comment.
This needs to be higher in the page. It is one of the more subtle issues.
There was a problem hiding this comment.
Moved "Customize version codes in Gradle build scripts" to the first bullet in Summary and the first section under Migration guide in 295ba7d, ahead of split-per-ABI missing-versionCode errors, build types, APK outputs, task lookups, add-to-app, and plugins.
| Landed in version: 3.49.0-0.1.pre, 3.50.0-0.1.pre, and 3.50.0-0.4.pre<br> | ||
| In stable release: 3.50 |
There was a problem hiding this comment.
lets not talk about pre release versions in this documenation.
| [PR 193962]: {{site.repo.flutter}}/pull/193962 | ||
| [PR 195640]: {{site.repo.flutter}}/pull/195640 | ||
| [PR 196561]: {{site.repo.flutter}}/pull/196561 | ||
| [PR 196692]: {{site.repo.flutter}}/pull/196692 |
There was a problem hiding this comment.
I am skeptical of the value of this whole section. If it is relevent it should be much more clear what the value is and why it is worth the readers attention.
There was a problem hiding this comment.
Trimmed References in 295ba7d down to four reader-facing links (the Android Variant API documentation, the built-in Kotlin migration guide, and tracking issues flutter/flutter#180137 and flutter/flutter#190845), each stating why to visit or follow it, and removed the deleted contributor doc link.
There was a problem hiding this comment.
break this into a different pull request. Add @jesswrd as a reviewer to that new pr.
There was a problem hiding this comment.
Migrating-Flutter-Gradle-Plugin-to-AGP-public-API.md was the work log for the AGP 9.1.0 migration stack, and website-page-draft.md was the draft of the user-facing page. The breaking-change pages in flutter/website#14053 are now the user-facing record. Point the FlutterPlugin.kt KDoc at that page and drop the doc path from the InternalAgpApiImportTest message.
|
/gcbrun |
|
Staged preview of the updated docs.flutter.dev site (updated for commit 68193c1): https://flutter-docs-prod--docs-pr14053-android-3-50-build-bre-3jt6dd3t.web.app |
| ## Summary | ||
|
|
||
| Android Gradle Plugin (AGP) 9 deprecated its legacy variant APIs, | ||
| and AGP 10 removes them. |
There was a problem hiding this comment.
I dont think that is true. Look for evidence that is public that says that or soften the language to something that indicates flutter believes they will or that we want to be prepared if they do.
There was a problem hiding this comment.
Checked Android's public documentation and AGP 9.3.1 bytecode:
- AGP DSL/API migration timeline (
AGP 10.0->What is being removed and replaced) states: "All previous interfaces and classes used in the legacy DSL and the old Variant API are deleted", listingapplicationVariants,libraryVariants,testVariants,unitTestVariants,android.newDsl, andandroid.builtInKotlinunder AGP 10.0 removals—with the top-level caveat "Note: The following timeframes are estimates and are subject to change." - AGP 9.0.0 release notes state: "Caution: The ability to opt-out will be removed in AGP 10.0 (mid-2026)."
- AGP 9.4.0 release notes state: "Starting with AGP 10, the new Variant API is mandatory for all projects."
- AGP 9.3.1 bytecode (
com.android.tools.build:gradle:9.3.1):DeprecationTarget.LEGACY_VARIANT_API,BooleanOption.USE_NEW_DSL,BooleanOption.BUILT_IN_KOTLIN, andBooleanOption.ENABLE_LEGACY_APIall setremovalTarget = Version.VERSION_10_0.
Because AGP 10 hasn't shipped yet (the current preview on agp-preview is AGP 9.6.0-alpha05, and Android's timeline notes estimates are subject to change), updated in 2b78fa0 to link the AGP migration timeline directly and soften "AGP 10 removes them" to "the AGP migration timeline schedules their removal for AGP 10. To prepare, the Flutter Gradle Plugin (FGP) in Flutter 3.50 uses AGP's public Variant API..." (and updated the summary and triage table from "AGP 10 readiness" / "AGP 10 compatibility" to "test without legacy AGP APIs"). Also aligned the wording and #android-gradle-plugin-new-dsl / #agp-10 anchors in #14090 (6572df9).
| ### Opt in to the new AGP DSL early | ||
|
|
||
| AGP 9 deprecated the legacy DSL and variant APIs behind `android.newDsl=false`, | ||
| and AGP 10 removes both `android.newDsl=false` and the legacy APIs. |
There was a problem hiding this comment.
also mentioned here. I need to see some public evidence if we are going to keep this statement.
There was a problem hiding this comment.
Updated in 2b78fa0 to link both public Android sources directly and soften "AGP 10 removes..." to scheduled removal:
- AGP 9.0.0 release notes (
#android-gradle-plugin-new-dsl): documentsandroid.newDsl=falseand states "Caution: The ability to opt-out will be removed in AGP 10.0 (mid-2026)." - AGP DSL/API migration timeline (
#agp-10): listsandroid.newDslandapplicationVariants/libraryVariantsunderWhat is being removed and replacedfor AGP 10.0 (with "Note: The following timeframes are estimates and are subject to change"), and notes under#agp-10-opt-out-subproject: "will be removed along withandroid.newDslin AGP 10.0."
The section now links both pages and reads: "AGP 9 enables the new AGP DSL by default and deprecates the legacy DSL and variant APIs behind android.newDsl=false. The AGP migration timeline schedules the removal of android.newDsl=false and the legacy variant APIs for AGP 10."
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
| FGP no longer calls `android.applicationVariants`, `android.libraryVariants`, | ||
| `variant.outputs`, or `versionCodeOverride`. |
There was a problem hiding this comment.
| FGP no longer calls `android.applicationVariants`, `android.libraryVariants`, | |
| `variant.outputs`, or `versionCodeOverride`. |
End users dont need to know this as a top line entry.
| - Sets `versionCode = flutter.versionCode` in `defaultConfig` | ||
| (the Flutter template default), | ||
| or sets a positive decimal integer `android:versionCode` in | ||
| `src/main/AndroidManifest.xml`. |
There was a problem hiding this comment.
| - Sets `versionCode = flutter.versionCode` in `defaultConfig` | |
| (the Flutter template default), | |
| or sets a positive decimal integer `android:versionCode` in | |
| `src/main/AndroidManifest.xml`. | |
| - Sets a positive integer `android:versionCode` in `src/main/AndroidManifest.xml`. | |
| - Or uses `versionCode = flutter.versionCode` in `defaultConfig` which is the Flutter template default. |
Also does the value have to be set in src/main/AndroidManifest.xml?
| `src/main/AndroidManifest.xml`. | ||
| - Doesn't read or customize `versionCode` in `onVariants` or | ||
| `applicationVariants`, hook into Flutter's Gradle tasks or | ||
| `merge<Variant>Assets/` paths, or use custom add-to-app settings. |
There was a problem hiding this comment.
| `merge<Variant>Assets/` paths, or use custom add-to-app settings. | |
| `merge<Variant>Assets/` paths, or use custom add-to-app settings (uncommon). |
| `merge<Variant>Assets/` paths, or use custom add-to-app settings. | ||
|
|
||
| Flutter 3.50 keeps `android.newDsl=false` by default, | ||
| so `android.applicationVariants` still works except in `--split-per-abi` |
There was a problem hiding this comment.
| so `android.applicationVariants` still works except in `--split-per-abi` | |
| so apps that depend on `android.applicationVariants` still works except in `--split-per-abi` |
|
/gcbrun |
| Match your role, build pattern, or Gradle error to its migration section: | ||
|
|
||
| | Role | Symptom, build pattern, or error | Migration section | | ||
| | :--- | :--- | :--- | | ||
| | App developer | Computes custom `versionCode` values in `onVariants`, `applicationVariants`, or `versionCodeOverride` | [Customize version codes in Gradle build scripts][vc-custom] | | ||
| | App developer | Hits `Querying the mapped value ... resolveManifestVersionCode<Variant>` or `CircularEvaluationException` on `versionCode` | [Customize version codes in Gradle build scripts][vc-custom] | | ||
| | App developer | Fails `--split-per-abi` with `Flutter cannot give ... variant '<name>' a versionCode` or `Circular dependency ... resolveManifestVersionCode<Variant>` (with or without `-P force-version-code-ignoring-abi=true`) | [Fix split-per-ABI version code errors][vc-split] | | ||
| | App developer | Sets `outputFileName`, copies APKs, or fails naming `SingleArtifact.APK` | [Rename, copy, or transform APK outputs][apk-outputs] | | ||
| | App developer | Hits `UnknownTaskException` or `ClassCastException` on `copyFlutterAssets<Variant>`, or reads `merge<Variant>Assets/` | [Configure Flutter Gradle tasks in build scripts][flutter-tasks] | | ||
| | App developer | Enables `android.newDsl=true` to test without legacy AGP APIs | [Opt in to the new AGP DSL early][opt-in] | | ||
| | Add-to-app or AAR | Logs a `flutter.hostAppProjectName` warning, uses custom host build types, or runs `flutter build aar --flavor` | [Update add-to-app projects and AAR builds][add-to-app] | | ||
| | Plugin author | Calls `android.libraryVariants`, `android.applicationVariants`, or Flutter's tasks in a plugin | [Migrate Android plugins][plugins] | |
There was a problem hiding this comment.
This should probably not be a table almost all the entries are app developers and "Add-to-app or AAR" is also an app developer. The only entry that is not is the plugin developer so lets make that its own subtitle.
There was a problem hiding this comment.
Replaced the role/symptom table with a bulleted Check whether your app needs updates list (including add-to-app and AAR) and a separate For plugin authors subtitle in 6aa630e.
| (`android.applicationVariants`, `android.libraryVariants`, | ||
| and `versionCodeOverride`). |
There was a problem hiding this comment.
Removed the parenthetical legacy API list from Background in 6aa630e.
| With `flutter build apk --split-per-abi`, Flutter sets each ABI output's | ||
| `versionCode` to `abiOffset * 1000 + versionCode` | ||
| (`1` for `armeabi-v7a`, `2` for `arm64-v8a`, and `4` for `x86_64`). | ||
| If that default numbering fits your app, | ||
| you don't need a custom `versionCode` block. |
There was a problem hiding this comment.
This section should start with the change compared to the previous 3.47 version.
There was a problem hiding this comment.
Rewrote the opening of Customize version codes in Gradle build scripts in 6aa630e to lead with the 3.47 vs. 3.50 behavior change.
| Compute custom `versionCode` values from a base input you control, | ||
| such as `flutter.versionCode`, a product flavor's `versionCode`, | ||
| or your own Gradle `Provider`. | ||
| Don't read or map `output.versionCode` or legacy `variant.versionCode`: | ||
|
|
||
| - On manifest-only `--split-per-abi` builds, calling `output.versionCode.get()`, | ||
| `output.versionCode.orNull`, or legacy `variant.versionCode` or | ||
| `output.versionCode` fails at configuration with | ||
| `Querying the mapped value ... resolveManifestVersionCode<Variant>`. | ||
| - Calling `output.versionCode.set(output.versionCode.map { ... })` fails with | ||
| Gradle's `CircularEvaluationException`. | ||
| - Disabling `android.compatibility.enableLegacyApi` also blocks | ||
| configuration-time reads of `output.versionCode` when `defaultConfig` sets | ||
| `versionCode`. |
There was a problem hiding this comment.
I think we want to hide this behind an expanded section. Most users are not going to follow this information. What they need to know is how to tell if they are impacted and how to get the behavior they want and why it matters. Perhaps lead with how to tell (compare a previous release to a 3.50 release with a command to get the in value when using split per abi).
There was a problem hiding this comment.
Reworked this section in 6aa630e to lead with the 3.47->3.50 change, why Google Play monotonic version codes matter, how to compare 3.47 vs. 3.50 APKs with apkanalyzer manifest version-code, and the fix. Moved the configuration-time errors and 3-way math table into an expandable <details> section.
| You need no changes here if `android {}` sets `versionCode` in `defaultConfig` | ||
| (such as `versionCode = flutter.versionCode`) or on each product flavor, | ||
| or if the main manifest (`src/main/AndroidManifest.xml` by default) | ||
| sets a positive decimal integer `android:versionCode` ([Issue 196559][]). | ||
| When `android {}` sets `versionCode`, | ||
| Flutter uses that DSL value and doesn't read any `AndroidManifest.xml`. | ||
| Non-split APKs, `flutter build appbundle`, and `flutter run` don't run this | ||
| check. | ||
| If you set `android:versionCode` only in the main manifest, | ||
| `--build-number` has no effect because that flag updates `flutter.versionCode` | ||
| only. | ||
|
|
||
| When `android {}` omits `versionCode`, Flutter matches AGP and reads | ||
| `android:versionCode` only from the main manifest. | ||
| Manifests in other source sets (build type, flavor, or variant) and | ||
| generated manifests don't count. | ||
| In Flutter 3.50.1 and later, `--split-per-abi` (or `-Psplit-per-abi=true`) | ||
| fails in `resolveManifestVersionCode<Variant>` when `android {}` omits | ||
| `versionCode` and the main manifest lacks a positive decimal | ||
| `android:versionCode`. | ||
| This check runs both by default and with | ||
| `-P force-version-code-ignoring-abi=true`: |
There was a problem hiding this comment.
A list of things that don't happen is hard for human readers in this context. Can you keep the technical details correct and focus on when devs should do something or how they can gain confidence the something they need to do works.
There was a problem hiding this comment.
Rewrote Fix split-per-ABI version code errors in 6aa630e to remove the list of things that don't happen and lead with when to act, the defaultConfig fix, and how to verify the output APKs with apkanalyzer.
| When `android {}` omits `versionCode`, common causes of this error are | ||
| omitting `android:versionCode` in `src/main/AndroidManifest.xml`, setting a | ||
| manifest value `<= 0`, or using `${vc}` placeholders, `@integer/...` | ||
| resources, or `0x...` hex literals. | ||
| In Flutter 3.50.0, omitting `versionCode` in `android {}` left split APKs | ||
| without per-ABI offsets (or with an empty `versionCode` when the manifest | ||
| also omitted it, which fails updates over a versioned build with | ||
| `INSTALL_FAILED_VERSION_DOWNGRADE`). | ||
| In Flutter 3.47 and earlier, `versionCodeOverride` added the per-ABI offset to | ||
| the legacy `variant.versionCode`: omitting `android:versionCode` defaulted to | ||
| `-1` (producing `999`, `1999`, and `3999`), values `<= 0` were offset as-is | ||
| (for example, `0` produced `1000`, `2000`, and `4000`), and non-decimal | ||
| manifest values failed with a `NumberFormatException`. | ||
| Without `-P force-version-code-ignoring-abi=true`, builds also fail if | ||
| `abiOffset * 1000 + versionCode` exceeds 2,147,483,647 | ||
| (the highest base `versionCode` across all three ABIs is 2,147,479,647). | ||
| To fix missing, non-positive, or non-decimal manifest values, set | ||
| `versionCode = flutter.versionCode` in `defaultConfig` (or per flavor) and | ||
| remove `android:versionCode` from `AndroidManifest.xml`. | ||
| To share an existing positive `versionCode` across split APKs outside Google | ||
| Play, refer to [Keep a single version code across split APKs][vc-single]. |
There was a problem hiding this comment.
This information is good but the presentation is super hard to follow for users new to the concepts being presented.
There was a problem hiding this comment.
Broke up the dense edge-case paragraph in 6aa630e and moved the manifest causes, overflow limits, 3.50.0/3.47 history, and generated-manifest cycle into a bulleted <details> block.
| Code before migration: | ||
|
|
||
| ```properties title="<host-app>/gradle.properties" | ||
| org.gradle.jvmargs=-Xmx4G | ||
| flutter.hostAppProjectName=my_host_app | ||
| ``` | ||
|
|
||
| Code after migration: | ||
|
|
||
| ```properties title="<host-app>/gradle.properties" | ||
| org.gradle.jvmargs=-Xmx4G | ||
| # Remove flutter.hostAppProjectName; Flutter resolves module assets per variant. | ||
| ``` |
There was a problem hiding this comment.
I think this before an after might be better conveyed through a diff like syntax instead of before and after blocks.
There was a problem hiding this comment.
Converted the small same-file before/after snippets (defaultConfig, copyFlutterAssetsDebug, hostAppProjectName, and matchingFallbacks) to diff code blocks in 6aa630e.
|
/gcbrun |
|
/gcbrun |
|
|
||
| ### Check whether your app needs updates | ||
|
|
||
| Jump to any matching section below, or skip the rest of this page. |
There was a problem hiding this comment.
why would "or skip the rest of this page." be a correct choice?
There was a problem hiding this comment.
Clarified the condition in 99c1ae3: 'Jump to any section below that matches your project. If none match, your app needs no migration changes for Flutter 3.50.'
|
|
||
| #### Uncommon build patterns | ||
|
|
||
| Skip these unless your Gradle scripts or error logs match: |
There was a problem hiding this comment.
what is "these" that should be skipped?
There was a problem hiding this comment.
Named the referent directly in 99c1ae3: 'Most apps don't use these patterns; skip the sections below unless your Gradle scripts or error logs match:'
| | ABI (`abiOffset`) | `flutter.versionCode`: `abiOffset * 1000 + 42 * 10000` | Unmigrated `variant.versionCode`: `abiOffset * 1000 + 1042 * 10000` | `onVariants` scaling `output.versionCode`: `(abiOffset * 1000 + 42) * 10000` | | ||
| | :--- | :--- | :--- | :--- | | ||
| | `armeabi-v7a` (1) | 421000 | 10421000 | 10420000 | | ||
| | `arm64-v8a` (2) | 422000 | 10422000 | 20420000 | | ||
| | `x86_64` (4) | 424000 | 10424000 | 40420000 | |
There was a problem hiding this comment.
what is this table supposed to show?
There was a problem hiding this comment.
Added an intro sentence explaining what the table compares (expected version codes vs. inflated values when reading variant.versionCode or output.versionCode) and simplified the column headers in 99c1ae3.
| Because `kotlin-android` rejects `android.newDsl=true`, keep both properties | ||
| `false` if any plugin still applies it. | ||
|
|
||
| Once both hold, enable the new DSL in `android/gradle.properties` (Flutter's |
There was a problem hiding this comment.
| Once both hold, enable the new DSL in `android/gradle.properties` (Flutter's | |
| Once both are true, enable the new DSL in `android/gradle.properties` (Flutter's |
|
/gcbrun |
…l versions (#14090) _Description of what this PR is changing or adding, and why:_ Adds the Flutter 3.50 Android breaking-change and migration guide **Raised minimum Android build tool versions** (`/release/breaking-changes/android-build-tool-minimum-versions`, split out from #14053) and lists the page under "Released in Flutter 3.50" in the breaking-changes index: - Documents the Flutter 3.50 minimums: AGP **9.1.1** (up from 8.11.1), Gradle **9.3.1** (up from 8.14.0), and KGP **2.4.10** when KGP is applied (up from 2.2.20), along with the Flutter 3.50 template defaults (AGP 9.3.1, Gradle 9.5.0, KGP 2.4.20) and the validation error rejecting **AGP 10+**. - Summarizes what projects need to do across projects already meeting the 3.50 minimums, Flutter apps and add-to-app host projects below the minimums (including unmodified apps created with Flutter 3.47 or earlier), standalone Flutter modules, and Android plugins. - Provides copyable before/after snippets for `settings.gradle.kts` `plugins {}` blocks and `gradle-wrapper.properties`, plus guidance on `android.builtInKotlin=false`, and `android.newDsl=false` > [!IMPORTANT] > **Open question before marking ready for review:** > Under `## Background`, the page links the [Android dependency versions support policy](https://docs.flutter.dev/go/android-dependency-versions) ("warn for at least one stable release before raising the minimum"). In Flutter 3.50, AGP `9.0.1`–`9.1.0`, Gradle `9.1.0`–`9.3.0`, and KGP `2.3.20`–`2.4.9` fail validation without a prior warning in Flutter 3.47. Confirm whether to keep the page focused on the 3.50 minimums as written, or add an explicit note that 3.50 made an exception to the warning-cycle policy. Companion PR for the Flutter Gradle Plugin Variant API migration guide: #14053 _Issues fixed by this PR (if any):_ None. _PRs or commits this PR depends on (if any):_ None. ## Presubmit checklist - [x] If you are unwilling, or unable, to sign the CLA, even for a _tiny_, one-word PR, please file an issue instead of a PR. - [x] If this PR is not meant to land until a future stable release, mark it as draft with an explanation. - [x] This PR follows the [Google Developer Documentation Style Guidelines](https://developers.google.com/style)—for example, it doesn't use _i.e._ or _e.g._, and it avoids _I_ and _we_ (first-person pronouns). - [x] This PR uses [semantic line breaks](https://github.com/dart-lang/site-shared/blob/main/doc/writing-for-dart-and-flutter-websites.md#semantic-line-breaks) of 80 characters or fewer. --------- Co-authored-by: Jessie Wong <jesswon@google.com>
|
/gcbrun |
| The ABI multipliers are 1 for `armeabi-v7a`, 2 for `arm64-v8a`, and 4 for | ||
| `x86_64`. | ||
|
|
||
| Scripts that add to or multiply that offset ship inflated version codes. |
There was a problem hiding this comment.
We may want to also highlight that if they are also multiplying by 1000 they could easily start running into the max integer value. WDYT?
There was a problem hiding this comment.
That is a good idea. Will incorporate.
|
Quick checklist of concrete items to fold into the next pass before merging:
From Kevin by way of Agent Dash. |
|
/gcbrun |
|
/gcbrun |
1 similar comment
|
/gcbrun |
Description of what this PR is changing or adding, and why:
Adds the Flutter 3.50 Android breaking-change and migration guide
Flutter Gradle Plugin uses the Android Gradle Plugin Variant API
(
/release/breaking-changes/flutter-gradle-plugin-variant-api)and lists the page under "Released in Flutter 3.50" in the breaking-changes
index:
authors: confirms when no build-script edits are needed, notes the immediate
--split-per-abiimpact on scripts readingvariant.versionCodeoroutput.versionCodeeven whileandroid.newDsl=falseis the default,summarizes the Flutter 3.50.1 fixes for the 3.50.0 regressions
(Cannot use
applicationIdSuffixin the profile mode (Flutter 3.50) flutter#196412, [Android] 3.50 regression: custom build types (initWith(release), isShrinkResources, buildConfigField, resValue) break builds that use plugins flutter#196696, [Android] --split-per-abi gives every split APK the same versionCode when versionCode is set only in AndroidManifest.xml (3.50 regression) flutter#196559,Flutter 3.50.0 cannot load assets with filenames starting with a dot flutter#196444), and maps roles, build patterns, and exact Gradle
errors to migration sections.
migration scenario:
versionCodecalculations inandroidComponents.onVariantsandmigrating off
versionCodeOverride(guardingabi == nullfor non-splitand universal APK outputs, explaining the
1042first-split jump onunmigrated
variant.versionCode, and resolvingresolveManifestVersionCode<Variant>andCircularEvaluationExceptionerrors).
versionCodeerrors whenandroid {}omitsversionCodeand
src/main/AndroidManifest.xmllacks a positive decimal integerandroid:versionCode(including${vc},@integer/..., and0x...values,
Int.MAX_VALUEoverflow,addGeneratedManifestFilecircular taskdependencies,
--build-numberon manifest-only apps, and safe use of-P force-version-code-ignoring-abi=true).SingleArtifact.APKoutputs.tasks.matchingand readingmerged assets from
SingleArtifact.ASSETS(or the built APK/AAB) ratherthan
merge<Variant>Assets/(Flutter 3.50.0 cannot load assets with filenames starting with a dot flutter#196444).flutter.hostAppProjectNameremoval andmatchingFallbackson custom host build types),flutter build aarflavor matching, Android plugin migration, and opting in early with
android.newDsl=trueandandroid.builtInKotlin=true.sites/docs/src/content/add-to-app/android/project-setup.mdtoreplace the tip recommending
flutter.hostAppProjectNamewith a note thatFlutter 3.50 and later support any host project name without that property
(which now has no effect and logs a warning), linking to the migration
section.
Companion PR for raised minimum Android build tool versions in Flutter 3.50:
#14090
Issues fixed by this PR (if any):
PRs or commits this PR depends on (if any):
([stable] [FGP] Add Flutter assets after AGP's asset merge so dotfiles are packaged flutter#196721),
[FGP] Offset split-APK versionCodes from a manifest-only versionCode flutter#196561, and
[flutter_tools] Do not copy app-only build type properties onto library plugins flutter#196692 into Flutter
3.50.1.Presubmit checklist
of 80 characters or fewer.