Skip to content

Commit

Permalink
Fix some of the errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Nov 7, 2022
1 parent d4115ab commit cb0f5fe
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Documentation/guides/messages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ or 'Help->Report a Problem' in Visual Studio for Mac.
+ [XA1028](xa1028.md): The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.
+ [XA1029](xa1029.md): The 'AotAssemblies' MSBuild property is deprecated. Edit the project file in a text editor to remove this property, and use the 'RunAOTCompilation' MSBuild property instead.
+ [XA1031](xa1031.md): The 'AndroidHttpClientHandlerType' has an invalid value.
+ [XA1032](xa1032.md):Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.
+ [XA1033](xa1033.md): Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.

## XA2xxx: Linker

Expand Down
19 changes: 19 additions & 0 deletions Documentation/guides/messages/xa1032.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Xamarin.Android error XA1032
description: XA1032 error code
ms.date: 10/10/2022
---
# Xamarin.Android error XA1032

## Example messages

```
Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.
```

## Solution

Edit your csproj directly and change the 'AndroidHttpClientHandlerType' to
a valid value.

Valid values can be found at `~/android/deploy-test/building-apps/build-properties.md#AndroidHttpClientHandlerType`.
19 changes: 19 additions & 0 deletions Documentation/guides/messages/xa1033.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Xamarin.Android error XA1033
description: XA1033 error code
ms.date: 10/10/2022
---
# Xamarin.Android error XA1033

## Example messages

```
Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.
```

## Solution

Edit your csproj directly and change the 'AndroidHttpClientHandlerType' to
a valid value.

Valid values can be found at `~/android/deploy-test/building-apps/build-properties.md#AndroidHttpClientHandlerType`.
18 changes: 18 additions & 0 deletions 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.

11 changes: 11 additions & 0 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,17 @@ Please change the value to an assembly-qualifed type name which inherits from '{
<comment>The following are literal names and should not be translated: 'AndroidHttpClientHandlerType',
{0} - The value of the property.
{1} - A type from which the AndroidHttpClientHandlerType should derive .</comment>
</data>
<data name="XA1032" xml:space="preserve">
<value>Failed to resolve '{0}' from '{1}'. Please check your `AndroidHttpClientHandlerType` setting.</value>
<comment>The following are literal names and should not be translated: 'AndroidHttpClientHandlerType',
{0} - The value of the property.
{1} - The name of the assembly.</comment>
</data>
<data name="XA1033" xml:space="preserve">
<value>Could not resolve '{0}'. Please check your `AndroidHttpClientHandlerType` setting.</value>
<comment>The following are literal names and should not be translated: 'AndroidHttpClientHandlerType',
{0} - The value of the property.</comment>
</data>
<data name="XA2000" xml:space="preserve">
<value>Use of AppDomain.CreateDomain() detected in assembly: {0}. .NET 6 and higher will only support a single AppDomain, so this API will no longer be available in Xamarin.Android once .NET 6 is released.</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override bool RunTask ()
}
}
if (foundAssembly == null) {
Log.LogError ($"Could not resolve '{assembly}'. Please check your `AndroidHttpClientHandlerType` setting.");
Log.LogCodedError ("XA1033", Xamarin.Android.Tasks.Properties.Resources.XA1033, assembly);
return !Log.HasLoggedErrors;
}
// find the type.
Expand All @@ -63,7 +63,7 @@ public override bool RunTask ()
break;
}
if (handlerType == null) {
Log.LogError ($"Failed to resolve '{type}' from '{assembly}'. Please check your `AndroidHttpClientHandlerType` setting.");
Log.LogCodedError ("XA1032", Xamarin.Android.Tasks.Properties.Resources.XA1032, type, assembly);
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ public void CheckForInvalidHttpClientHandlerType ()
};
using (var b = CreateApkBuilder ()) {
b.ThrowOnBuildFailure = false;
proj.SetProperty ("AndroidHttpClientHandlerType", "invalidvalue");
Assert.IsFalse (b.Build (proj), "Build should have succeeded.");
proj.SetProperty ("AndroidHttpClientHandlerType", "Android.App.Application");
Assert.IsFalse (b.Build (proj), "Build should not have succeeded.");
Assert.IsTrue (StringAssertEx.ContainsText (b.LastBuildOutput, "XA1031"), "Output should contain XA1031");
}
}
Expand Down

0 comments on commit cb0f5fe

Please sign in to comment.