Problem
In NativeLinker.ExtractDebugSymbols, the LogFailure local function calls log.LogError with a format string that has no placeholders, so the library filename and command output are silently dropped. Users see only "Failed to extract debug info" with zero context. Additionally, the message lacks an XA#### error code and is hardcoded instead of using Properties.Resources. Two inline TODO comments explicitly ask for this to be fixed.
Location
- File:
src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.cs
- Lines: 402–408
Current Code
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 ());
}
Bug: TaskLoggingHelper.LogError(string message, params object[] messageArgs) calls string.Format(message, messageArgs). Since the message "Failed to extract debug info" contains no {0} or {1} placeholders, the library filename and the command output are silently ignored.
Suggested Fix
- Add a new resource string
XA3008 to src/Xamarin.Android.Build.Tasks/Properties/Resources.resx:
<data name="XA3008" xml:space="preserve">
<value>Failed to extract debug info from '{0}': {1}</value>
<comment>'{0}' is the native shared library filename. '{1}' is the full output of the failed command, starting and ending with a newline.</comment>
</data>
-
Update Resources.Designer.cs to add the corresponding property (run the designer generator, or add manually following the pattern of XA3007).
-
Replace the LogFailure method with:
void LogFailure ()
{
var sb = MonoAndroidHelper.MergeStdoutAndStderrMessages (stdoutLines, stderrLines);
log.LogCodedWarning ("XA3008", Properties.Resources.XA3008, Path.GetFileName (sourceLib), sb.ToString ());
}
Note: This changes from LogError to LogCodedWarning as the first TODO suggests. Debug symbol extraction failing is non-fatal — by this point the shared library has already been linked successfully (line 267). Failing the entire build over debug symbols is unnecessarily harsh.
-
Remove both TODO comments (lines 405–406) since they will be resolved.
-
Create documentation at Documentation/docs-mobile/messages/xa3008.md following the existing format:
---
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: ...
```
6. **Add the new code to the index** in `Documentation/docs-mobile/messages/index.md` after the XA3007 line:
```
+ XA3008: Failed to extract debug info from '{library}'
Guidelines
- Only modify the English
Resources.resx file (not localized .resx files)
- Use
LogCodedWarning (not LogCodedError) since debug symbol extraction is non-fatal
- Follow the existing pattern of
XA3007 for the resource entry format and Designer.cs property
- Use tabs for indentation (Mono code style)
Acceptance Criteria
Generated by Nightly Fix Finder for issue #11352 · ● 4M · ◷
Problem
In
NativeLinker.ExtractDebugSymbols, theLogFailurelocal function callslog.LogErrorwith a format string that has no placeholders, so the library filename and command output are silently dropped. Users see only"Failed to extract debug info"with zero context. Additionally, the message lacks anXA####error code and is hardcoded instead of usingProperties.Resources. Two inline TODO comments explicitly ask for this to be fixed.Location
src/Xamarin.Android.Build.Tasks/Utilities/NativeLinker.csCurrent Code
Bug:
TaskLoggingHelper.LogError(string message, params object[] messageArgs)callsstring.Format(message, messageArgs). Since the message"Failed to extract debug info"contains no{0}or{1}placeholders, the library filename and the command output are silently ignored.Suggested Fix
XA3008tosrc/Xamarin.Android.Build.Tasks/Properties/Resources.resx:Update
Resources.Designer.csto add the corresponding property (run the designer generator, or add manually following the pattern ofXA3007).Replace the
LogFailuremethod with:Note: This changes from
LogErrortoLogCodedWarningas the first TODO suggests. Debug symbol extraction failing is non-fatal — by this point the shared library has already been linked successfully (line 267). Failing the entire build over debug symbols is unnecessarily harsh.Remove both TODO comments (lines 405–406) since they will be resolved.
Create documentation at
Documentation/docs-mobile/messages/xa3008.mdfollowing the existing format:Guidelines
Resources.resxfile (not localized.resxfiles)LogCodedWarning(notLogCodedError) since debug symbol extraction is non-fatalXA3007for the resource entry format and Designer.cs propertyAcceptance Criteria
XA3008resource string added toResources.resxandResources.Designer.csLogFailureuseslog.LogCodedWarning("XA3008", ...)with proper format placeholdersDocumentation/docs-mobile/messages/xa3008.mdDocumentation/docs-mobile/messages/index.md