From 6c50723c8056caabee40ac071295396f6d0c1256 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 20:48:29 +0000 Subject: [PATCH 1/3] Initial plan From 0ace01798f6e61ee2102a9a1c45d5a5cbbdffb01 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 15 May 2026 21:13:23 +0000 Subject: [PATCH 2/3] Fix NativeLinker.LogFailure: add XA3008 coded warning with format arguments - Add XA3008 resource string to Resources.resx and Resources.Designer.cs - Replace LogError with LogCodedWarning using proper format placeholders - Remove resolved TODO comments - Add documentation at Documentation/docs-mobile/messages/xa3008.md - Add XA3008 to message index Agent-Logs-Url: https://github.com/dotnet/android/sessions/bc30af09-6939-40cd-b8ad-c12a52ac522d Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com> --- Documentation/docs-mobile/messages/index.md | 1 + Documentation/docs-mobile/messages/xa3008.md | 28 +++++++++++++++++++ .../Properties/Resources.Designer.cs | 9 ++++++ .../Properties/Resources.resx | 4 +++ .../Utilities/NativeLinker.cs | 4 +-- 5 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 Documentation/docs-mobile/messages/xa3008.md diff --git a/Documentation/docs-mobile/messages/index.md b/Documentation/docs-mobile/messages/index.md index 14d5a6c0442..6cd2fc181e1 100644 --- a/Documentation/docs-mobile/messages/index.md +++ b/Documentation/docs-mobile/messages/index.md @@ -168,6 +168,7 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla + XA3005: The detected Android NDK version is incompatible with the targeted LLVM configuration. + XA3006: Could not compile native assembly file: {file} + XA3007: Could not link native shared library: {library} ++ XA3008: Failed to extract debug info from '{library}' ## XA4xxx: Code generation diff --git a/Documentation/docs-mobile/messages/xa3008.md b/Documentation/docs-mobile/messages/xa3008.md new file mode 100644 index 00000000000..ce3adea1383 --- /dev/null +++ b/Documentation/docs-mobile/messages/xa3008.md @@ -0,0 +1,28 @@ +--- +title: .NET for Android warning XA3008 +description: XA3008 warning code +ms.date: 05/15/2026 +f1_keywords: + - "XA3008" +--- + +# .NET for Android warning XA3008 + +## Issue + +This warning is emitted when the build system fails to extract debug symbols from +a native shared library using `objcopy`. The shared library itself was linked +successfully, but separate debug symbol files (`.dbg.so`) could not be created. + +## Solution + +This warning is non-fatal and the app will still work correctly. Debug symbols +are used for native crash diagnostics. If you need native debug symbols, check +that the NDK `objcopy` tool is installed and functioning correctly. + +## Example messages + +``` +warning XA3008: Failed to extract debug info from 'libmonodroid.so': +objcopy: error: ... +``` diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 890e2142dd1..4404de08ea4 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -1091,6 +1091,15 @@ public static string XA3007 { } } + /// + /// Looks up a localized string similar to Failed to extract debug info from '{0}': {1}. + /// + public static string XA3008 { + get { + return ResourceManager.GetString("XA3008", resourceCulture); + } + } + /// /// Looks up a localized string similar to Failed to generate Java type for class: {0} due to {1}. /// diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index ae4698f69eb..d7a655b542c 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -589,6 +589,10 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla Could not link native shared library: {0}{1} The '{1}' placeholder is replaced with full output of the failed command, starting and ending with a newline. + + Failed to extract debug info from '{0}': {1} + '{0}' is the native shared library filename. '{1}' is the full output of the failed command, starting and ending with a newline. + Failed to generate Java type for class: {0} due to {1} {0} - The managed type name diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 05f7568a6ae..7b7084ed3cc 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -402,9 +402,7 @@ bool ExtractDebugSymbols (ITaskItem outputSharedLibrary) void LogFailure () { var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); - // TODO: consider making it a warning - // TODO: make it a coded message - log.LogError ("Failed to extract debug info", Path.GetFileName (sourceLib), sb.ToString ()); + log.LogCodedWarning ("XA3008", Properties.Resources.XA3008, Path.GetFileName (sourceLib), sb.ToString ()); } } From 61717f670c59572a5fd5ed80fbbe54385455fa26 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 18 May 2026 09:29:54 -0500 Subject: [PATCH 3/3] Fix XA3008 review comments: use LogCodedError, fix format string, fix docs - Change LogCodedWarning to LogCodedError since the method returns false (build-fatal), matching the original LogError behavior - Remove ": " before {1} in format string to match XA3007 pattern ({0}{1}) since MergeStdoutAndStderrMessages already includes leading newline - Update docs to reference llvm-objcopy (actual NDK tool) and mark as error Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Documentation/docs-mobile/messages/xa3008.md | 18 ++++++++---------- .../Properties/Resources.Designer.cs | 2 +- .../Properties/Resources.resx | 2 +- .../Utilities/NativeLinker.cs | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Documentation/docs-mobile/messages/xa3008.md b/Documentation/docs-mobile/messages/xa3008.md index ce3adea1383..b958e94ee90 100644 --- a/Documentation/docs-mobile/messages/xa3008.md +++ b/Documentation/docs-mobile/messages/xa3008.md @@ -1,28 +1,26 @@ --- -title: .NET for Android warning XA3008 -description: XA3008 warning code +title: .NET for Android error XA3008 +description: XA3008 error code ms.date: 05/15/2026 f1_keywords: - "XA3008" --- -# .NET for Android warning XA3008 +# .NET for Android error XA3008 ## Issue -This warning is emitted when the build system fails to extract debug symbols from -a native shared library using `objcopy`. The shared library itself was linked +This error is emitted when the build system fails to extract debug symbols from +a native shared library using `llvm-objcopy`. The shared library itself was linked successfully, but separate debug symbol files (`.dbg.so`) could not be created. ## Solution -This warning is non-fatal and the app will still work correctly. Debug symbols -are used for native crash diagnostics. If you need native debug symbols, check -that the NDK `objcopy` tool is installed and functioning correctly. +Check that the NDK `llvm-objcopy` tool is installed and functioning correctly. ## Example messages ``` -warning XA3008: Failed to extract debug info from 'libmonodroid.so': -objcopy: error: ... +error XA3008: Failed to extract debug info from 'libmonodroid.so' +llvm-objcopy: error: ... ``` diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs index 4404de08ea4..968e6e5e289 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs @@ -1092,7 +1092,7 @@ public static string XA3007 { } /// - /// Looks up a localized string similar to Failed to extract debug info from '{0}': {1}. + /// Looks up a localized string similar to Failed to extract debug info from '{0}'{1}. /// public static string XA3008 { get { diff --git a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx index d7a655b542c..0e852f935d2 100644 --- a/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx +++ b/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx @@ -590,7 +590,7 @@ Either change the value in the AndroidManifest.xml to match the $(SupportedOSPla The '{1}' placeholder is replaced with full output of the failed command, starting and ending with a newline. - Failed to extract debug info from '{0}': {1} + Failed to extract debug info from '{0}'{1} '{0}' is the native shared library filename. '{1}' is the full output of the failed command, starting and ending with a newline. diff --git a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs index 7b7084ed3cc..1ea2b57c29b 100644 --- a/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs +++ b/src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs @@ -402,7 +402,7 @@ bool ExtractDebugSymbols (ITaskItem outputSharedLibrary) void LogFailure () { var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines); - log.LogCodedWarning ("XA3008", Properties.Resources.XA3008, Path.GetFileName (sourceLib), sb.ToString ()); + log.LogCodedError ("XA3008", Properties.Resources.XA3008, Path.GetFileName (sourceLib), sb.ToString ()); } }