Skip to content

[flutter_plugin_tools] Use Flutter pub for packages depending on jni - #12857

Draft
awishere wants to merge 1 commit into
flutter:mainfrom
awishere:codex/fix-flutter-publish-jni
Draft

[flutter_plugin_tools] Use Flutter pub for packages depending on jni#12857
awishere wants to merge 1 commit into
flutter:mainfrom
awishere:codex/fix-flutter-publish-jni

Conversation

@awishere

Copy link
Copy Markdown

Packages with a jni dependency can require the Flutter SDK even when their pubspec has no direct Flutter SDK dependency. The publishing tool currently selects dart pub publish for this case, causing dependency resolution to fail for packages such as pigeon.

Recognize jni in both dependencies and dev dependencies in the shared Flutter-requirement check. This follows the narrow known-dependency approach suggested in the issue and also applies to the other pub commands using that helper. It does not attempt to resolve arbitrary transitive dependency graphs.

Fixes flutter/flutter#192709.

Validation (Dart 3.12.2, macOS arm64, from script/tool):

  • The three new regression tests fail before the fix: both dependency checks return false, and the publishing test records dart pub publish instead of flutter pub publish.
  • dart test — all 1,238 tests passed, including existing direct-Flutter and Dart-only behavior.
  • dart analyze — no issues found.
  • dart format --set-exit-if-changed . — 106 files, no changes.
  • git diff --check — passed.

Publishing is exercised through the existing mocked process runner; no package was published.

Prepared with Codex assistance. This PR is a draft pending the contributor's personal review of the code and description under Flutter's AI contribution guidelines. CLA status has not yet been verified.

Pre-Review Checklist

Footnotes

  1. The tool version is incremented to 0.14.4+2 and its changelog records the fix. Validation covers the complete flutter_plugin_tools test suite, not unrelated plugin suites. 2

@google-cla

google-cla Bot commented Sep 13, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[packages] Dart packages with Flutter-requiring dev dependencies fail to publish

1 participant