Skip to content

Implement version code overrides for split ABIs - #187742

Merged
auto-submit[bot] merged 11 commits into
flutter:masterfrom
derdilla:49544-allow-overriding-versioncode
Jun 26, 2026
Merged

auto-submit[bot] merged 11 commits into
flutter:masterfrom
derdilla:49544-allow-overriding-versioncode

Conversation

@derdilla

@derdilla derdilla commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor

closes #49544 by implementing a flag to force the flutter plugin to not run override the version code for split APIs.

More or less follows what #177753 did. The design should be sufficient to hook into custom build systems and doesn't do anything else.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. team-android Owned by Android platform team labels Jun 9, 2026
@derdilla
derdilla marked this pull request as ready for review June 9, 2026 18:40
@derdilla
derdilla requested a review from a team as a code owner June 9, 2026 18:40
@derdilla
derdilla requested review from camsim99 and removed request for a team June 9, 2026 18:40
@derdilla
derdilla marked this pull request as draft June 9, 2026 18:40

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Gradle property, force-version-code-ignoring-abi, allowing developers to bypass ABI-specific version code overrides during Flutter builds. Feedback on the changes highlights several critical issues in the integration tests, including a missing comma leading to implicit string concatenation, a misplaced closing brace that prematurely terminates the main function, and an incorrect aapt command for extracting the APK version code. Additionally, a relative import should be replaced with a package import to adhere to the style guide.

Comment thread packages/flutter_tools/test/integration.shard/gradle_jni_packaging_test.dart Outdated
Comment thread packages/flutter_tools/test/integration.shard/gradle_jni_packaging_test.dart Outdated
Comment thread packages/flutter_tools/test/integration.shard/gradle_jni_packaging_test.dart Outdated
@derdilla
derdilla marked this pull request as ready for review June 9, 2026 19:48

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Gradle property force-version-code-ignoring-abi to allow forcing the version code while ignoring the ABI split during Flutter builds, and adds an integration test to verify this behavior. Feedback on the integration test points out compatibility issues on Windows environments, such as incorrect path escaping, carriage return handling, missing directory checks, and the wrong executable name for aapt.

@derdilla

derdilla commented Jun 9, 2026 •

Copy link
Copy Markdown
Contributor Author

I still get a test failure. Not sure whether that is a wrong local setup (using wrong flutter), or a bug. I guess running in CI is easiest to check that.

@camsim99 camsim99 added the CICD Run CI/CD label Jun 15, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 16, 2026
@camsim99 camsim99 added the CICD Run CI/CD label Jun 16, 2026

@camsim99 camsim99 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! Overall it seems fair to me, but the test needs to be adjusted to work on Windows.

Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt
@camsim99
camsim99 requested a review from gmackall June 16, 2026 15:47
derdilla added 3 commits June 17, 2026 09:34
looking at _checkLibIsInApk the other path changes don't seem necessary
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 17, 2026
@derdilla

Copy link
Copy Markdown
Contributor Author

Thanks for the review. The linked test looks like it creates the android directories from scratch. Based on the runner log I went with the simple binary renaming. Let's see how that goes

@jmagman jmagman added the CICD Run CI/CD label Jun 18, 2026
@derdilla
derdilla requested a review from camsim99 June 22, 2026 12:58
camsim99
camsim99 previously approved these changes Jun 22, 2026

@camsim99 camsim99 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I like the short version of the comment! @gmackall for second review

Comment thread packages/flutter_tools/templates/app/android-java.tmpl/app/build.gradle.kts.tmpl Outdated
@jesswrd jesswrd added the CICD Run CI/CD label Jun 23, 2026
@jesswrd
jesswrd requested a review from camsim99 June 23, 2026 21:26
sfshaza2 pushed a commit to flutter/website that referenced this pull request Jun 26, 2026
_Description of what this PR is changing or adding, and why:_
As asked in a review of the linked pull request: This pull request
updates the Android deployment documentation to explain how split APKs
affect the version code and how to bypass this behavior during a build.

_Issues fixed by this PR (if any):_

_PRs or commits this PR depends on (if any):_
- flutter/flutter#187742

## 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: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@derdilla

Copy link
Copy Markdown
Contributor Author

Now that the tree is green again, could this get merged?

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Jun 26, 2026
@gmackall gmackall added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 26, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jun 26, 2026
Merged via the queue into flutter:master with commit dfbca72 Jun 26, 2026
170 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
This was referenced Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD platform-android Android applications specifically team-android Owned by Android platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flutter version code is different from version code in google play console

5 participants