Skip to content

fix(sdk): Align AndroidX.Wear pins and Wear minSdk - #23993

Merged
ajpinedam merged 2 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/wear-androidx-pins
Aug 7, 2026
Merged

ajpinedam merged 2 commits into
unoplatform:masterfrom
ajpinedam:dev/anpi/wear-androidx-pins

Conversation

@ajpinedam

@ajpinedam ajpinedam commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #23991

PR Type:

🐞 Bugfix

What changed? 🚀

A new unoapp with the Wear OS feature enabled fails to restore for net10.0-android with three NU1605 package-downgrade errors: Uno.Sdk pins Xamarin.AndroidX.Wear to 1.4.0.1 for net10.0, but that revision's dependency floors (RecyclerView ≥ 1.4.0.5, SwipeRefreshLayout ≥ 1.2.0.2, Fragment 1.8.9.2 → Activity ≥ 1.12.4.1) are all above the versions the SDK pins. The base (net9.0) pin 1.3.0.16 has the same problem against the base pin set, so net9.0-android was equally broken.

This PR makes the AndroidWear feature restore and build out of the box:

  • packages.json: pin AndroidXWear to the revisions that ship in the same dotnet/android-libraries wave as the rest of the pinned set — 1.3.0.14 (base) / 1.3.0.15 (net10.0). Down-pinning Wear keeps the change scoped to the Wear feature; raising the other AndroidX pins up to Wear 1.4.0.1's floors was validated and rejected, because Activity 1.12.x floors androidx.lifecycle 2.10 (minSdk 23), which breaks every default (minSdk 21) Android app, and on net9.0 it drags in the broken Compose.Runtime.Annotation 1.10.0.1 packaging wave (D8 duplicate-class failure).
  • Uno.Common.Android.targets: when the androidwear feature is enabled and SupportedOSPlatformVersion is not set explicitly, default it to 26.0 instead of 21.0 — Xamarin.AndroidX.Wear.Tiles brings in androidx.wear.protolayout, whose AAR requires minSdk 26 (manifest-merge AMM0000 otherwise).
  • validate-packages-json.ps1 (CI guard, second commit): in addition to the existing exists-on-NuGet check, validate that the pinned Xamarin.* set is mutually dependency-coherent per TFM pin set, by walking nuspec dependency floors (recursing through unpinned intermediates such as Fragment). This is exactly the gap the existing guard could not catch: 1.4.0.1 exists on NuGet, but is incoherent with the surrounding pins. On the pre-fix manifest the check reports 8 conflicts (4 per TFM set — including a Collection floor violation that a default app cannot surface); on this PR's manifest it passes.
  • android-wear.md: document the minSdk 26 default.

Validation (all runtime, Uno.Sdk 6.7.0-dev.165 with the changed files injected)

Scenario Before After
dotnet new unoapp -platforms android --includeAndroidWear, net10.0-android restore fails, 3× NU1605 restore + build clean (0 errors, 0 warnings)
Same app on net9.0-android restore fails, 3× NU1605 restore + build clean
Plain unoapp (no Wear), net10.0-android builds builds (pins for non-Wear apps unchanged — no blast radius)
CI guard on pre-fix packages.json passes (misses the bug) fails with 8 dependency conflicts, exit 1
CI guard on this PR's packages.json — passes, exit 0

PR Checklist ✅

  • 🧪 Added Runtime tests, UI tests, or a manual test sample (for bug fixes / features, if applicable) — covered by the CI guard's new dependency-coherence check, which fails on the pre-fix manifest and passes on this one
  • 📚 Docs have been added/updated following the documentation template (for bug fixes / features)
  • 🖼️ Validated PR Screenshots Compare Test Run results.
  • ❗ Contains NO breaking changes
  • 👀 Reviewed 2 other open pull requests (optional but appreciated!)

Copilot AI lite review requested due to automatic review settings August 6, 2026 18:17
@ajpinedam ajpinedam self-assigned this Aug 6, 2026
@unodevops

Copy link
Copy Markdown
Contributor

@unodevops

Copy link
Copy Markdown
Contributor

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@ajpinedam
ajpinedam enabled auto-merge August 6, 2026 20:04
@kazo0

kazo0 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@Mergifyio backport release/stable/6.7

@mergify

mergify Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

backport release/stable/6.7

✅ Backports have been created

Details

@ajpinedam
ajpinedam merged commit 1476d2b into unoplatform:master Aug 7, 2026
59 checks passed
@mergify

mergify Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

kazo0 added a commit that referenced this pull request Aug 7, 2026
…6.7/pr-23993

fix(sdk): Align AndroidX.Wear pins and Wear minSdk (backport #23993)
@ajpinedam
ajpinedam deleted the dev/anpi/wear-androidx-pins branch August 7, 2026 13:23
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.

Restore fails with NU1605 (AndroidX package downgrades) when the Wear OS feature is enabled

4 participants