-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tasks] Improve XA1011 error wording (#4779)
Context: https://developercommunity.visualstudio.com/content/problem/1043110/xamarin-androidlinktool-dx.html Seeing the localized version of the message for XA1011 in context from a real user's build made @brendanzagaeski realize that the original wording he wrote for that message was problematic. One issue was that messages for Xamarin.Android build errors are not currently accompanied by their numbered error codes when they appear in the Error List in Visual Studio. This means that users who see a localized translation for a message will likely search online using the localized text instead of the numbered code and will have a more challenging time finding corresponding release notes and documentation pages. Another problem was that the error message used "`$(AndroidLinkTool)`" as a kind of abbreviation for "the `AndroidLinkTool` MSBuild property". The idea was that `$(AndroidLinkTool)` matched the MSBuild syntax for retrieving a property value and would therefore indicate that `AndroidLinkTool` was an MSBuild property, but Xamarin.Android users don't typically need to interact too much with MSBuild syntax, so they wouldn't necessarily recognize the meaning of the abbreviation. On top of that, in user projects, `AndroidLinkTool` would be more likely to appear in an XML tag like `<AndroidLinkTool>` than in a property retrieval like `$(AndroidLinkTool)`, so the use of `$(AndroidLinkTool)` in the error message could potentially cause some confusion. To help address these problems, adjust the wording of the XA1011 error. In addition to replacing "`$(AndroidLinkTool)`" with "`AndroidLinkTool` MSBuild property", make the message more actionable by adding information about how to change the corresponding code shrinker setting in the Visual Studio project property pages. [A number of the messages from the dotnet/sdk repo][0] use similar wording to refer to MSBuild properties. One difference is that those messages say "property" instead of "MSBuild property." @brendanzagaeski prefers "MSBuild property" because he believes it will help prevent ambiguity, especially in the localized translations. TODO: Audit all of the other errors and warnings that currently use the `$()` syntax, and make similar changes as appropriate. [0]: https://github.com/dotnet/sdk/blob/1ce8d7029b267c335bf606c591a97bfb9824ece1/src/Tasks/Common/Resources/Strings.resx
- Loading branch information
1 parent
5b436c2
commit c17445c
Showing
18 changed files
with
68 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
--- | ||
title: Xamarin.Android error XA1011 | ||
description: XA1011 error code | ||
ms.date: 04/03/2020 | ||
ms.date: 06/05/2020 | ||
--- | ||
# Xamarin.Android error XA1011 | ||
|
||
## Example messages | ||
|
||
``` | ||
error XA1011: Using ProGuard with the D8 DEX compiler is no longer supported. Please update `$(AndroidLinkTool)` to `r8`. | ||
error XA1011: Using ProGuard with the D8 DEX compiler is no longer supported. Please set the code shrinker to `r8` in the Visual Studio project property pages or edit the project file in a text editor and set the `AndroidLinkTool` MSBuild property to `r8`. | ||
``` | ||
|
||
## Issue | ||
|
||
The project has `$(AndroidDexTool)` set to `d8` and `$(AndroidLinkTool)` set to | ||
`ProGuard`. In the past this configuration was allowed, but now only the R8 | ||
code shrinker is supported for use with the D8 DEX compiler. | ||
The project is currently configured to use the D8 DEX compiler in combination | ||
with the ProGuard code shrinker. In the past, using the ProGuard code shrinker | ||
with the D8 DEX compiler was allowed, but now, only the R8 code shrinker is | ||
supported for use with the D8 DEX compiler. | ||
|
||
## Solution | ||
|
||
Update the `$(AndroidLinkTool)` MSBuild property to `r8` to select the R8 code | ||
shrinker. This property corresponds to the **Code shrinker** setting in the | ||
Visual Studio project properties pages. | ||
Set the **Code shrinker** in the Visual Studio project properties pages to | ||
**r8**, or edit the project file [in Visual Studio][edit-project-files] or | ||
another text editor and set the `AndroidLinkTool` MSBuild property to `r8`: | ||
|
||
```xml | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<AndroidLinkTool>r8</AndroidLinkTool> | ||
</PropertyGroup> | ||
``` | ||
|
||
R8 might in some cases produce new build warnings or errors compared to | ||
ProGuard, so the ProGuard rules for the project might require a few updates to | ||
resolve any new warnings or errors that appear after this change. | ||
|
||
[edit-project-files]: https://docs.microsoft.com/visualstudio/msbuild/visual-studio-integration-msbuild#edit-project-files-in-visual-studio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#### Application and library build and deployment | ||
|
||
- _error XA1011: Using ProGuard with the D8 DEX compiler is no longer supported. | ||
Please update \`$(AndroidLinkTool)\` to \`r8\`._ did not mention the | ||
corresponding term _code shrinker_ that is used in the Visual Studio project | ||
property pages and did not mention that `AndroidLinkTool` is an MSBuild | ||
property. |
4 changes: 2 additions & 2 deletions
4
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.