Repository navigation
[Android] Remove obsolete XA4218 workaround - #37941
Conversation
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Updates the pinned `@microsoft/vally-cli` version used by skill validation and live soak workflows from 0.12.0 to the latest stable release, 0.14.0. Also updates direct lint command examples and makes eval-spec comments version-neutral where the described scoring behavior remains unchanged. ## Validation - Installed Vally 0.14.0 through `.github/scripts/SetupVallyRuntime.sh` - Strict-linted all 16 Vally evaluation specifications with Vally 0.14.0 Co-authored-by: PureWeen <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e73594e-38bc-4937-80c8-cc054aa890d2
The Android SDK has handled optional missing uses-library entries since dotnet/android#9085, so MAUI no longer needs to demote XA4218 warnings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 68923130-f067-406b-9fd4-e4145dd0983b
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 37941Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 37941" |
|
@jonathanpeppers In an attempt to remove TODOs from the codebase, I came across this XA4218 workaround. The upstream issue was fixed by dotnet/android#9085 in July 2024, and the current .NET 10 / Android 36 toolchain passed the optional-library scenario without the suppression while still warning for required missing libraries. Does this seem like something we can remove? |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
jonathanpeppers
left a comment
There was a problem hiding this comment.
It seems like it was fixed in 2024:
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Review tier: Lite
Findings: None
What changed in this PR
This PR removes an Android-specific MSBuild workaround in the Microsoft.Maui.Core build-transitive targets that previously downgraded XA4218 from warning/error to a message for Android builds. This aligns MAUI’s packaging with the current behavior of dotnet/android where XA4218 is no longer emitted for missing optional <uses-library android:required="false"> entries.
Changes:
- Removed the
MSBuildWarningsAsMessages;XA4218injection forTargetPlatformIdentifier == AndroidfromMicrosoft.Maui.Core.After.targets.
| File | Description |
|---|---|
| src/Core/src/nuget/buildTransitive/Microsoft.Maui.Core.After.targets | Removes the Android XA4218 warnings-as-messages workaround from the build-transitive targets. |
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! ## Description Removes the obsolete Android workaround that added `XA4218` to `MSBuildWarningsAsMessages` from the `Microsoft.Maui.Core` build-transitive targets. The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing `<uses-library android:required="false">` entries no longer emit XA4218, while required missing libraries still correctly warn. The current repository targets .NET 10 and Android API 36, well after the upstream fix. ## Validation - Packed `Microsoft.Maui.Core`, `Microsoft.Maui.Essentials`, and `Microsoft.Maui.Graphics` for `net10.0-android36.0` after the removal. - Referenced the locally packed `Microsoft.Maui.Core` package from a minimal Android app. - Confirmed the packaged `Microsoft.Maui.Core.After.targets` no longer adds XA4218 to `MSBuildWarningsAsMessages`. - Confirmed a missing optional `androidx.window.sidecar` library builds with `-warnaserror` with 0 warnings and 0 errors. - Confirmed the same missing library with `android:required="true"` emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries. ## Issues Fixed Relates to dotnet/android#6809. --------- Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
Removes the obsolete Android workaround that added
XA4218toMSBuildWarningsAsMessagesfrom theMicrosoft.Maui.Corebuild-transitive targets.The workaround referenced dotnet/android#6809. That issue was fixed by dotnet/android#9085 in July 2024: optional missing
<uses-library android:required="false">entries no longer emit XA4218, while required missing libraries still correctly warn.The current repository targets .NET 10 and Android API 36, well after the upstream fix.
Validation
Microsoft.Maui.Core,Microsoft.Maui.Essentials, andMicrosoft.Maui.Graphicsfornet10.0-android36.0after the removal.Microsoft.Maui.Corepackage from a minimal Android app.Microsoft.Maui.Core.After.targetsno longer adds XA4218 toMSBuildWarningsAsMessages.androidx.window.sidecarlibrary builds with-warnaserrorwith 0 warnings and 0 errors.android:required="true"emits XA4218, proving the Android manifest task executes and preserves the intended warning for required libraries.Issues Fixed
Relates to dotnet/android#6809.