From 7f81a6cf84eec69dfb0ae1b242c869ed2b17e2ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 20:32:50 +0000 Subject: [PATCH 1/2] Initial plan From 3bd04607b4c1829d7c194a9badb09d51d381449d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:25:37 +0000 Subject: [PATCH 2/2] Fix NativeAOT Android app crash with UnsatisfiedLinkError Set _UseNativeLibPrefix=true so the NativeAOT SDK produces the native binary with the "lib" prefix from the start (e.g. libMyApp.so). Android requires native libraries to have this prefix. Also update soname to use $(NativeBinaryPrefix) for consistency and make _AndroidFixNativeLibraryFileName handle both cases (with and without NativeBinaryPrefix) for backward compatibility. Fixes #10822 Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- .../targets/Microsoft.Android.Sdk.NativeAOT.targets | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets index 8fcdee6c961..b6ab19c3b48 100644 --- a/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets +++ b/src/Xamarin.Android.Build.Tasks/Microsoft.Android.Sdk/targets/Microsoft.Android.Sdk.NativeAOT.targets @@ -25,6 +25,9 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. <_GenerateProguardAfterTargets>_AndroidComputeIlcCompileInputs + + <_UseNativeLibPrefix Condition=" '$(_UseNativeLibPrefix)' == '' ">true @@ -100,7 +103,7 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - + @@ -211,8 +214,10 @@ This file contains the NativeAOT-specific MSBuild logic for .NET for Android. - + + +