Skip to content

Commit

Permalink
Error documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpobst committed Feb 8, 2024
1 parent 2e95c8e commit 1659801
Show file tree
Hide file tree
Showing 18 changed files with 397 additions and 42 deletions.
3 changes: 1 addition & 2 deletions Documentation/guides/JavaDependencyVerification.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,10 @@ Additionally, a POM file can "import" dependency information from another POM fi
</dependencyManagement>
```

Dependency information cannot be accurately determined without also having access to these additional POM files, and will results in errors like:
Dependency information cannot be accurately determined without also having access to these additional POM files, and will results in an error like:

```
error : Unable to resolve POM for artifact 'com.squareup.okio:okio-parent:1.17.4'.
error : Could not verify Java dependencies for artifact 'com.squareup.okio:okio:1.17.4' due to missing POM files. See other error(s) for details.
```

In this case, we need to provide the POM file for `com.squareup.okio:okio-parent:1.17.4`:
Expand Down
34 changes: 34 additions & 0 deletions Documentation/guides/messages/xa4234.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: .NET Android error XA4234
description: XA4234 error code
ms.date: 02/26/2024
---
# .NET Android error XA4234

## Example message

```
error XA4234: '<AndroidMavenLibrary>' item 'com.example:mylib' is missing required attribute 'Version'.
```

## Issue

The specified MSBuild XML item requires the specified XML attribute.

For example the following item is missing the required 'Version' attribute:

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" />
</ItemGroup>
```

## Solution

To resolve this error, ensure that the specified XML contains the specified attribute:

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" Version="1.0.0" />
</ItemGroup>
```
34 changes: 34 additions & 0 deletions Documentation/guides/messages/xa4235.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: .NET Android error XA4235
description: XA4235 error code
ms.date: 02/26/2024
---
# .NET Android error XA4235

## Example message

```
error XA4235: Maven artifact specification 'com.example' is invalid. The correct format is 'group_id:artifact_id'.
```

## Issue

The specified Maven artifact specification is invalid.

For example the following item uses a comma separator instead of a colon:

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example,mylib" Version="1.0.0" />
</ItemGroup>
```

## Solution

To resolve this error, ensure that the artifact specification is of the form 'group_id:artifact_id':

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" Version="1.0.0" />
</ItemGroup>
```
37 changes: 37 additions & 0 deletions Documentation/guides/messages/xa4236.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: .NET Android error XA4236
description: XA4236 error code
ms.date: 02/26/2024
---
# .NET Android error XA4236

## Example message

```
error XA4236: Cannot download Maven artifact 'com.example:mylib'.
error XA4236: - mylib-1.0.0.jar: Response status code does not indicate success: 404 (Not Found).
error XA4236: - mylib-1.0.0.aar: Response status code does not indicate success: 404 (Not Found).
```

## Issue

Errors were encountered while trying to download the requested Java library from Maven.

For example the following item doesn't actually exist on Maven Central, resulting in "Not Found":

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" Version="1.0.0" />
</ItemGroup>
```

## Solution

Resolving this error depends on the error message specified.

It could be things like:
- Check your internet connection.
- Ensure you have specified the correct group id and artifact id.
- Ensure you have specified the correct Maven repository.

Additional documentation about configuring `<AndroidMavenLibrary>` is available [here](../AndroidMavenLibrary.md).
24 changes: 24 additions & 0 deletions Documentation/guides/messages/xa4237.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: .NET Android error XA4237
description: XA4237 error code
ms.date: 02/26/2024
---
# .NET Android error XA4237

## Example message

```
error XA4237: Cannot download POM file for Maven artifact 'com.example:mylib':1.0.0.
error XA4237: - mylib-1.0.0.pom: Response status code does not indicate success: 404 (Not Found).
```

## Issue

An error was encountered while trying to download the requested POM file from Maven.

## Solution

Resolving this error depends on the error message specified.

It could be things like:
- Check your internet connection.
34 changes: 34 additions & 0 deletions Documentation/guides/messages/xa4239.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: .NET Android error XA4239
description: XA4239 error code
ms.date: 02/26/2024
---
# .NET Android error XA4239

## Example message

```
error XA4239: Unknown Maven repository: 'example.com'.
```

## Issue

The specified Maven repository is invalid.

For example the following Maven repository must be specified with `https://`:

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" Version="1.0.0" Repository="example.com" />
</ItemGroup>
```

## Solution

To resolve this error, ensure that the Maven repository follows the [documented values](../AndroidMavenLibrary.md):

```xml
<ItemGroup>
<AndroidMavenLibrary Include="com.example:mylib" Version="1.0.0" Repository="https://example.com" />
</ItemGroup>
```
22 changes: 22 additions & 0 deletions Documentation/guides/messages/xa4241.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: .NET Android error XA4241
description: XA4241 error code
ms.date: 02/26/2024
---
# .NET Android error XA4241

## Example message

```
error XA4241: Java dependency 'org.jetbrains.kotlin:kotlin-stdlib:1.9.0' is not satisfied.
```

## Issue

The specified Java dependency could not be verified using the [Java Dependency Verification](../JavaDependencyVerification.md)
feature.

## Solution

To resolve this error, follow the available options in the [Resolving Java Dependencies](../ResolvingJavaDependencies.md)
documentation.
27 changes: 27 additions & 0 deletions Documentation/guides/messages/xa4242.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: .NET Android error XA4242
description: XA4242 error code
ms.date: 02/26/2024
---
# .NET Android error XA4242

## Example message

Java dependency '{0}' is not satisfied. Microsoft maintains the NuGet package '{1}' that could fulfill this dependency.

```
error XA4242: Java dependency 'org.jetbrains.kotlin:kotlin-stdlib:1.9.0' is not satisfied.
Microsoft maintains the NuGet package 'Xamarin.Kotlin.StdLib' that could fulfill this dependency.
```

## Issue

The specified Java dependency could not be verified using the [Java Dependency Verification](../JavaDependencyVerification.md)
feature.

## Solution

Add a reference to the specified NuGet package to the project.

Alternatively, choose one of the other available options in the [Resolving Java Dependencies](../ResolvingJavaDependencies.md)
documentation.
36 changes: 36 additions & 0 deletions Documentation/guides/messages/xa4243.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: .NET Android error XA4243
description: XA4243 error code
ms.date: 02/26/2024
---
# .NET Android error XA4243

## Example message

```
error XA4243: Attribute 'JavaVersion' is required when using 'JavaArtifact' for 'ProjectReference' item '../ReferenceProject.csproj'.
```

## Issue

The referenced MSBuild item XML specifies an attribute that makes an additional attribute required.

For example, using the `JavaArtifact` attribute on a `<ProjectReference>` requires `JavaVersion` to also be specified.

Invalid:

```xml
<ItemGroup>
<ProjectReference Include="../ReferenceProject.csproj" JavaArtifact="com.example:mylib" />
</ItemGroup>
```

## Solution

To resolve this error, specify the required XML attribute:

```xml
<ItemGroup>
<ProjectReference Include="../ReferenceProject.csproj" JavaArtifact="com.example:mylib" JavaVersion="1.0.0" />
</ItemGroup>
```
36 changes: 36 additions & 0 deletions Documentation/guides/messages/xa4244.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: .NET Android error XA4244
description: XA4244 error code
ms.date: 02/26/2024
---
# .NET Android error XA4244

## Example message

```
error XA4244: Attribute 'JavaVersion' cannot be empty for 'ProjectReference' item '../ReferenceProject.csproj'.
```

## Issue

The referenced MSBuild item XML specifies a required attribute but omits a required value.

For example, the `JavaArtifact` attribute on a `<ProjectReference>` cannot have an empty value.

Invalid:

```xml
<ItemGroup>
<ProjectReference Include="../ReferenceProject.csproj" JavaArtifact="" JavaVersion="1.0.0" />
</ItemGroup>
```

## Solution

To resolve this error, specify a value for the required XML attribute:

```xml
<ItemGroup>
<ProjectReference Include="../ReferenceProject.csproj" JavaArtifact="com.example:mylib" JavaVersion="1.0.0" />
</ItemGroup>
```
32 changes: 32 additions & 0 deletions Documentation/guides/messages/xa4245.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: .NET Android error XA4245
description: XA4245 error code
ms.date: 02/26/2024
---
# .NET Android error XA4245

## Example message

```
error XA4245: Specified POM file 'mylib.pom' does not exist.
```

## Issue

The referenced MSBuild item XML specifies a POM file that cannot be found.

```xml
<ItemGroup>
<AndroidLibrary Include="mylib.jar" Manifest="mylib.pom" />
</ItemGroup>
```

```xml
<ItemGroup>
<AndroidAdditionalJavaManifest Include="mylib.pom" />
</ItemGroup>
```

## Solution

To resolve this error, ensure the requested POM file exists in the specified location.
21 changes: 21 additions & 0 deletions Documentation/guides/messages/xa4246.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: .NET Android error XA4246
description: XA4246 error code
ms.date: 02/26/2024
---
# .NET Android error XA4246

## Example message

```
error XA4246: Could not parse POM file 'mylib.pom'.
error XA4246: - There is an error in XML document (1, 1).
```

## Issue

The referenced POM file cannot be parsed.

## Solution

To resolve this error, ensure the requested POM file is valid XML.
22 changes: 22 additions & 0 deletions Documentation/guides/messages/xa4247.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: .NET Android error XA4247
description: XA4247 error code
ms.date: 02/26/2024
---
# .NET Android error XA4247

## Example message

```
error XA4247: Could not resolve POM file for artifact 'com.example:mylib-parent:1.0.0'.
```

## Issue

The specified POM file is needed to complete Java dependency verification, but it could
not be found. This may be due to a missing parent or imported POM file.

## Solution

For solutions for fixing this error, refer to the "Additional POM Files" section of the
[Java Dependency Verification](../JavaDependencyVerification.md) documentation.
Loading

0 comments on commit 1659801

Please sign in to comment.