-
Notifications
You must be signed in to change notification settings - Fork 538
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Add %(NuGetPackage*) to TaskItems (#9559)
Fixes: #9544 Context: 64bb147 [Google announced][0] that future versions of Android would require that native libraries use 16 KB page sizes on arm64. At present, the timeline for *when* 16 KB page sizes will be required is unknown, though we assume it will be with Android 16 or later. In order to get ahead of this, .NET 9 added an XA0141 warning in 64bb147. The problem is, this warning is not entirely actionable: dotnet new android dotnet add package Xamarin.GooglePlayServices.Vision.Face.Contour.Internal --version 116.1.0.19 dotnet build -c Release results in: warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details warning XA0141: NuGet package '<unknown>' version '<unknown>' contains a shared library 'libface_detector_v2_jni.so' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details What are customers supposed to *do* with this? The original assumption was that the NuGet package and Version would be available as metadata items on the MSBuild Items. Unfortunately that was not the case, so the data the user gets is empty. Add the required metadata to all NuGet Package references resolved by the project. This will allow us to propagate that data throughout the build Items as they are transformed. This means we can provide a decent error message to the user: warning XA0141: Android 16 will require 16 KB page sizes, shared library 'libface_detector_v2_jni.so' does not have a 16 KB page size. Please inform the authors of the NuGet package 'Xamarin.GooglePlayServices.Vision.Face.Contour.Internal' version '116.1.0.19' which contains 'lib/net8.0-android34.0/play-services-vision-face-contour-internal.aar'. See https://developer.android.com/guide/practices/page-sizes for more details. [0]: https://android-developers.googleblog.com/2024/08/adding-16-kb-page-size-to-android.html
- Loading branch information
1 parent
ace5169
commit 63cfce4
Showing
9 changed files
with
192 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
--- | ||
title: .NET for Android warning XA0141 | ||
description: XA0141 warning code | ||
ms.date: 22/07/2024 | ||
ms.date: 01/08/2025 | ||
--- | ||
# .NET for Android warning XA0141 | ||
|
||
## Issue | ||
|
||
NuGet package '{0}' version '{1}' contains a shared library '{2}' which is not correctly aligned. See https://developer.android.com/guide/practices/page-sizes for more details | ||
Future versions of Android on arm64 will require that native libraries use 16 KB page sizes. | ||
This requires that the mentioned native libraries be recompiled, and all apps using those | ||
native libraries be rebuilt to contain the fixed versions of the native libraries. | ||
|
||
See the Android SDK [Support 16 KB page sizes](https://developer.android.com/guide/practices/page-sizes) | ||
documentation for more information. | ||
|
||
## Solution | ||
|
||
The indicated native shared library must be recompiled and relinked with the 16k alignment, as per URL indicated in the message. | ||
The indicated native shared library must be recompiled and relinked with the 16k alignment, as per | ||
the Android SDK [Support 16 KB page sizes](https://developer.android.com/guide/practices/page-sizes) | ||
documentation. | ||
|
||
## Example messages | ||
|
||
> warning XA0141: Android 16 will require 16 KB page sizes, Shared library 'libface_detector_v2_jni.so' does not have a 16 KB page size. | ||
> Please inform the authors of the NuGet package 'Xamarin.GooglePlayServices.Vision.Face.Contour.Internal' version '116.1.0.19' | ||
> which contains 'lib/net8.0-android34.0/play-services-vision-face-contour-internal.aar'. | ||
> See https://developer.android.com/guide/practices/page-sizes for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.