Skip to content

[Android] Make sure jni libs are considered input to the merge task.#187688

Closed
mboetger wants to merge 17 commits into
flutter:masterfrom
mboetger:fix-187553
Closed

[Android] Make sure jni libs are considered input to the merge task.#187688
mboetger wants to merge 17 commits into
flutter:masterfrom
mboetger:fix-187553

Conversation

@mboetger

@mboetger mboetger commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Ensures jniLibs are considered inputs

Fixes: #187553

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@mboetger mboetger requested a review from a team as a code owner June 8, 2026 18:39
@mboetger mboetger requested review from reidbaker and removed request for a team June 8, 2026 18:39
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 8, 2026
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added platform-android Android applications specifically tool Affects the "flutter" command-line tool. See also t: labels. labels Jun 8, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 8, 2026
@mboetger mboetger changed the title make sure jni libs are considered inputs [Android] Make sure jni libs are considered inputs Jun 8, 2026
@mboetger mboetger changed the title [Android] Make sure jni libs are considered inputs [Android] Make sure jni libs are considered input to the merge task. Jun 8, 2026

@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 configures the merge JNI libraries task in FlutterPlugin.kt to include jniLibsDir as an input directory. Feedback suggests marking this input directory as optional using .optional() to prevent build failures in projects that do not contain JNI libraries, where the directory may not exist.

Comment thread packages/flutter_tools/gradle/src/main/kotlin/FlutterPlugin.kt Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 8, 2026
gmackall
gmackall previously approved these changes Jun 8, 2026
@mboetger mboetger added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 8, 2026
reidbaker
reidbaker previously approved these changes Jun 8, 2026

@reidbaker reidbaker 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.

Non blocking but if we want to not regress here we need a test.

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 8, 2026
@mboetger mboetger added the CICD Run CI/CD label Jun 8, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 8, 2026
@auto-submit

auto-submit Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187688, because - The status or check suite Windows module_custom_host_app_name_test has failed. Please fix the issues identified (or deflake) before re-applying this label.

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 9, 2026
@mboetger mboetger added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 9, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 9, 2026
@auto-submit

auto-submit Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/187688, because - The status or check suite Linux module_host_with_custom_build_test has failed. Please fix the issues identified (or deflake) before re-applying this label.

@mboetger mboetger added the CICD Run CI/CD label Jun 12, 2026
@mboetger

Copy link
Copy Markdown
Contributor Author

@reidbaker & @gmackall PTAL. I verified using 'files' also fixes the issue - and fixes the test failures in CI.

reidbaker
reidbaker previously approved these changes Jun 12, 2026
@reidbaker

Copy link
Copy Markdown
Contributor

Non blocking but if we want to not regress here we need a test.

What did you decide to do about this. Follow up PR? Too difficult to maintain?

@github-actions github-actions Bot added the team-android Owned by Android platform team label Jun 15, 2026
@mboetger

Copy link
Copy Markdown
Contributor Author

Non blocking but if we want to not regress here we need a test.

What did you decide to do about this. Follow up PR? Too difficult to maintain?

Added a test

@mboetger mboetger requested review from gmackall and reidbaker June 15, 2026 17:27
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 15, 2026
@mboetger mboetger added the CICD Run CI/CD label Jun 15, 2026
Comment thread packages/flutter_tools/test/integration.shard/gradle_merge_jni_libs_test.dart Outdated
Comment thread packages/flutter_tools/test/integration.shard/gradle_merge_jni_libs_test.dart Outdated
// Verify APK contains probe-BBBB and NOT probe-AAAA.
apkBytes = apkFile.readAsBytesSync();
archive = ZipDecoder().decodeBytes(apkBytes);
libappFile =

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.

Why here and above do you accept any of the 3 arch .so files?
Can we instead build an arch or build universal and know that our chosen arch will be there?

If for some reason we can't then please extract this logic into a helper method.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought flavors and abiFilters were currently broken: #188009 because of #181828

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.

They are only broken in the sense that if you try to reduce the abi support and dont pass the flag then you will not get reduced abi support. That is because the agp 9 apis only allow appending.

Comment thread packages/flutter_tools/test/integration.shard/gradle_merge_jni_libs_test.dart Outdated
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 16, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 16, 2026
@mboetger mboetger requested a review from reidbaker June 16, 2026 19:02
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 17, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 17, 2026

@gmackall gmackall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We currently enforce no trailing commas I believe

ij_kotlin_allow_trailing_comma = false

this was to support older kotlin versions. We can probably remove this (would check first!) but I expect the commas here will make ci fail. Interested to see if not though I suppose

@mboetger

Copy link
Copy Markdown
Contributor Author

We currently enforce no trailing commas I believe

ij_kotlin_allow_trailing_comma = false

this was to support older kotlin versions. We can probably remove this (would check first!) but I expect the commas here will make ci fail. Interested to see if not though I suppose

Yeah, I think my KTlint version is out of whack.

@mboetger mboetger added the l:backlog LLM created PR addressing a backlog issue. label Jun 18, 2026
@jesswrd

jesswrd commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

@gmackall is taking this over closing the RP out.

@jesswrd jesswrd closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD l:backlog LLM created PR addressing a backlog issue. 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 build apk --flavor silently packages stale Dart code: merge<Variant>JniLibFolders stays UP-TO-DATE after Dart changes (3.44 regression)

5 participants