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 ()); } }