Skip to content

Commit

Permalink
Use a coded error
Browse files Browse the repository at this point in the history
  • Loading branch information
grendello committed Sep 11, 2024
1 parent f3f19c2 commit d55e91a
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Documentation/docs-mobile/messages/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
--
title: .NET for Android errors and warnings reference
description: Build and deployment error and warning codes in .NET for Android, their meanings, and guidance on how to address them.
ms.date: 04/11/2024
Expand Down Expand Up @@ -104,6 +104,7 @@ or 'Help->Report a Problem' in Visual Studio for Mac.
+ [XA0139](xa0139.md): `@(AndroidAsset)` `{0}` has invalid `DeliveryType` metadata of `{1}`. Supported values are `installtime`, `ondemand` or `fastfollow`
+ [XA0140](xa0140.md):
+ [XA0141](xa0141.md): 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
+ [XA0142](xa0142.md): Command '{0}' failed.\n{1}

## XA1xxx: Project related

Expand Down
17 changes: 17 additions & 0 deletions Documentation/docs-mobile/messages/xa0142.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: .NET for Android error XA0142
description: XA0141 error code
ms.date: 11/09/2024
---
# .NET for Android warning XA0142

## Issue

Command '{0}' failed.\n{1}

## Solution

Examine logged output of the failed command for indications of what caused the issue. If no immediate
solution is suggested by the logged messages, please file an issue at https://github.com/dotnet/android
including the full error message and steps that led to the command failing (possibly including a small
repro application).
11 changes: 10 additions & 1 deletion src/Xamarin.Android.Build.Tasks/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1072,4 +1072,8 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
<comment>The following are literal names and should not be translated: Maven, group_id, artifact_id
{0} - A Maven artifact specification</comment>
</data>
<data name="XA0142" xml:space="preserve">
<value>Command '{0}' failed.\n{1}</value>
<comment>'{0}' is a failed command name (potentially with path) followed by all the arguments passed to it. {1} is the combined output on the standard error and standard output streams.</comment>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public static int RunProcess (string command, string arguments, TaskLoggingHelpe

if (proc.ExitCode != 0) {
var sb = MergeStdoutAndStderrMessages (stdoutLines, stderrLines);
log.LogError ($"Command '{psi.FileName} {psi.Arguments}' failed.\n{sb.ToString ()}");
log.LogCodedError ("XA0142", Properties.Resources.XA0142, $"{psi.FileName} {psi.Arguments}", sb.ToString ());
}

try {
Expand Down

0 comments on commit d55e91a

Please sign in to comment.