Skip to content

fix: Android fails to resolve native sources from the Pub cache on Windows (#177) - #183

Merged
efraespada merged 12 commits into
developfrom
bugfix/177-android-fails-to-resolve-native-sources-from-the-pub-cache-on-windows
Oct 29, 2026
Merged

efraespada merged 12 commits into
developfrom
bugfix/177-android-fails-to-resolve-native-sources-from-the-pub-cache-on-windows

Conversation

@efraespada

@efraespada efraespada commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Android Gradle now resolves the exact zstandard_native package selected by the consuming app or workspace and passes its source path to CMake. This fixes Pub-cache builds on Windows while preserving explicit overrides and repository-local builds.

What changed

  • Resolve the selected native package from the consumer's .dart_tool/package_config.json, including workspace configurations and relative or absolute file URIs.
  • Honor ZSTD_ROOT overrides and validate the selected source; invalid configured dependencies fail with a diagnostic instead of falling back to another cached package.
  • Add resolver regression cases for multiple cached versions, Windows paths, spaces, Unicode, overrides, invalid configurations, and repository fallback.
  • Add a Windows-hosted workflow that reproduces the published-package failure, checks the candidate resolver, and builds Android ARM64 native code.
  • Document Android source resolution and the Windows CI job's scope and requirements.

Validation

  • Windows final workflow passed: all 16 production Gradle resolver cases and a real Android ARM64/API 21 build with NDK 27.0.12077973 and CMake 3.22.1. Both packages were outside the checkout; cases include multiple cached versions, spaces and Unicode.
  • Original Windows reproduction verified the published 1.5.3 missing-source failure and a successful explicit-root control before the resolver was changed.
  • A separate Flutter consumer on macOS built an ARM64 APK with both candidate packages outside the app and checkout (AGP 9.1.0, Gradle 9.3.1); its actual CMake caches point to the selected package. This was a build check, not device execution.
  • Android publication dry-run includes android/native_sources.gradle and reports zero warnings.
  • Full platform and required-gate validation is tracked in this PR's checks. Copilot's ready-for-review analysis reported no findings.

Review notes

The Windows job verifies source discovery and compilation. Complete Flutter and JNI execution remains in the Linux Android matrix. Windows software-emulator trials did not achieve a stable boot; that infrastructure needs separate validation before adding mandatory runtime checks.

The new workflow uses the existing Windows X64 runner group, only same-repository code, contents: read, and checkout without persisted credentials. Its Python/Android tools use reviewed archive checksums; SDK, Gradle state and fixtures are job-local. Action references use version tags. Copilot installation files, policy and release workflows are unchanged.

Closes #177

@vypbot vypbot added the state:ai-processing A Copilot agent is analyzing or working on the issue or change. label Oct 29, 2026
@vypbot vypbot changed the title Fix Android native source discovery from hosted packages fix: Android fails to resolve native sources from the Pub cache on Windows (#177) Oct 29, 2026
@vypbot
vypbot self-requested a review October 29, 2026 09:31
@vypbot vypbot added this to vypdev Oct 29, 2026
@vypbot vypbot moved this to In Progress in vypdev Oct 29, 2026
@vypbot
vypbot changed the base branch from develop to master October 29, 2026 09:31
@vypbot vypbot added the size: M label Oct 29, 2026
@vypbot vypbot added state:reviewing A pull request is being reviewed. and removed state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Oct 29, 2026
@codecov-commenter

codecov-commenter commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.36%. Comparing base (9d5929c) to head (6b1c45b).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #183   +/-   ##
========================================
  Coverage    77.36%   77.36%           
========================================
  Files           14       14           
  Lines         1109     1109           
========================================
  Hits           858      858           
  Misses         251      251           
Flag Coverage Δ
cli 76.61% <ø> (ø)
platform_interface 85.71% <ø> (ø)
zstandard 88.33% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vypbot

vypbot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Copilot approval · Human review needed

Status: A protected workflow, policy, or trust-boundary file changed.
Completed: 3/3 observed checks succeeded; Bugbot complete.
Action required: Ask a human reviewer to decide.
Impact: No new approval is confirmed for this revision.
See checks

Technical evidence

Revision: 6b1c45bd1d07; base: 9d5929ca41b8; reason: protected-path.

@vypbot vypbot added size: L 10% Progress: 10% state:ai-processing A Copilot agent is analyzing or working on the issue or change. and removed size: M state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Oct 29, 2026
@vypbot vypbot added size: XL and removed size: L labels Oct 29, 2026
@vypbot vypbot added state:ai-processing A Copilot agent is analyzing or working on the issue or change. and removed state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Oct 29, 2026
@vypbot vypbot added state:ai-processing A Copilot agent is analyzing or working on the issue or change. state:reviewing A pull request is being reviewed. and removed state:blocked The workflow is blocked and needs human input. state:awaiting-maintainer The next action requires a maintainer response or approval. state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Oct 29, 2026
@efraespada
efraespada marked this pull request as ready for review October 29, 2026 11:59
@vypbot vypbot added size: XXL 65% Progress: 65% state:ai-processing A Copilot agent is analyzing or working on the issue or change. and removed size: XL 10% Progress: 10% labels Oct 29, 2026
@vypbot

vypbot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Bugbot: review complete

Current status: No active findings on 6b1c45b.

Pull request · Verified commit · Workflow run

@vypbot vypbot added state:ready The change is ready for human approval or merge. state:awaiting-maintainer The next action requires a maintainer response or approval. and removed state:reviewing A pull request is being reviewed. state:ai-processing A Copilot agent is analyzing or working on the issue or change. labels Oct 29, 2026
@efraespada
efraespada merged commit 689fc74 into develop Oct 29, 2026
62 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in vypdev Oct 29, 2026
@vypbot vypbot added state:verified The change has passed Copilot verification. and removed state:ready The change is ready for human approval or merge. state:awaiting-maintainer The next action requires a maintainer response or approval. labels Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

65% Progress: 65% size: XXL state:verified The change has passed Copilot verification.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛🧑‍💻 - Android fails to resolve native sources from the Pub cache on Windows

3 participants