Skip to content

Commit f0b8261

Browse files
authored
[Xamarin.Android.Build.Tasks] Remove AndroidUseAapt2 property (#9506)
Remove the `$(AndroidUseAapt2)` MSBuild property. All of the code it was protecting is now the default and users are no longer able to use `aapt`; this property is redundant. Update the `<ResolveAndroidTooling/>` task to look for `.cmd`, `.bat`, and `.exe` like we do other tools. While this is not needed at the moment, it is useful for unit tests since we cannot create a `.cmd` file and name it `.exe` and have it run. It also allows us the flexibility to write wrappers for the tool if needed.
1 parent 4488c48 commit f0b8261

File tree

42 files changed

+38
-1110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+38
-1110
lines changed

Documentation/docs-mobile/building-apps/build-process.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ The Following MSBuild properties are used to control generation of the
9494
- [`$(AndroidR8IgnoreWarnings)`](build-properties.md#androidr8ignorewarnings)
9595
- [`$(AndroidResgenExtraArgs)`](build-properties.md#androidresgenextraargs)
9696
- [`$(AndroidResgenFile)`](build-properties.md#androidresgenfile)
97-
- [`$(AndroidUseAapt2)`](build-properties.md#androiduseaapt2)
9897
- [`$(MonoAndroidResourcePrefix)`](build-properties.md#monoandroidresourceprefix)
9998

10099
## Signing properties

Documentation/docs-mobile/building-apps/build-properties.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,6 @@ that are intended for submission on Google Play. The default value is `apk`.
989989
When `$(AndroidPackageFormat)` is set to `aab`, other MSBuild
990990
properties are set, which are required for Android App Bundles:
991991

992-
- [`$(AndroidUseAapt2)`](build-properties.md#androiduseaapt2) is `True`.
993992
- [`$(AndroidUseApkSigner)`](#androiduseapksigner) is `False`.
994993
- [`$(AndroidCreatePackagePerAbi)`](#androidcreatepackageperabi) is `False`.
995994

@@ -1251,14 +1250,6 @@ Supported values include:
12511250

12521251
This property is obsolete and should not be used.
12531252

1254-
## AndroidUseAapt2
1255-
1256-
A boolean property that allows the developer to
1257-
control the use of the `aapt2` tool for packaging.
1258-
By default this will be True.
1259-
1260-
This property cannot be set to false.
1261-
12621253
## AndroidUseApkSigner
12631254

12641255
A bool property that allows the developer to

Documentation/guides/app-bundles.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ Due to the various requirements for Android App Bundles, here are a
133133
reasonable set of defaults for `bundletool`:
134134
```xml
135135
<AndroidPackageFormat Condition=" '$(AndroidPackageFormat)' == '' ">apk</AndroidPackageFormat>
136-
<AndroidUseAapt2 Condition=" '$(AndroidPackageFormat)' == 'aab' ">True</AndroidUseAapt2>
137136
<AndroidUseApkSigner Condition=" '$(AndroidPackageFormat)' == 'aab' ">False</AndroidUseApkSigner>
138137
<AndroidCreatePackagePerAbi Condition=" '$(AndroidCreatePackagePerAbi)' == 'aab' ">False</AndroidCreatePackagePerAbi>
139138
```

Localize/loc/cs/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[Používání AAPT je zastaralé, místo něj se používá AAPT2. Povolte prosím možnost Použít systém přírůstkového balení pro Android (aapt2) na stránce vlastností projektu sady Visual Studio, nebo upravte soubor projektu v textovém editoru a nastavte vlastnost MSBuildu AndroidUseAapt2 na true.]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[Používání AAPT se v projektech .NET pro Android, které cílí na .NET 6 nebo vyšší, nepodporuje. Povolte prosím možnost Použít systém přírůstkového balení pro Android (aapt2) na stránce vlastností projektu sady Visual Studio, nebo upravte soubor projektu v textovém editoru a nastavte vlastnost MSBuild AndroidUseAapt2 na true.]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

Localize/loc/de/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[Die Verwendung von AAPT wird zugunsten von AAPT2 eingestellt. Aktivieren Sie "Inkrementelles Android-Paketierungssystem (aapt2) verwenden" in den Visual Studio-Projekteigenschaftenseiten, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und legen Sie die MSBuild-Eigenschaft "AndroidUseAapt2" auf TRUE fest.]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[Die Verwendung von AAPT wird in .NET für Android-Projekten, die auf .NET 6 oder höher ausgerichtet sind, nicht unterstützt. Aktivieren Sie „Inkrementelles Android-Paketierungssystem (AAPT2) verwenden“ auf den Visual Studio-Projekteigenschaftsseiten, oder bearbeiten Sie die Projektdatei in einem Text-Editor, und legen Sie die MSBuild-Eigenschaft „AndroidUseAapt2“ auf WAHR fest.]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

Localize/loc/es/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[El uso de AAPT está en desuso en favor de AAPT2. Habilite "Use el sistema de empaquetado de Android incremental (aapt2)" en las páginas de propiedades del proyecto de Visual Studio o edite el archivo del proyecto en un editor de texto y establezca la propiedad "AndroidUseAapt2" de MSBuild en "true".]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[El uso de AAPT no es compatible con proyectos .NET para Android que tengan como objetivo .NET 6 o superior. Habilite "Usar el sistema de empaquetado de Android incremental (aapt2)" en las páginas de propiedades del proyecto de Visual Studio o edite el archivo del proyecto en un editor de texto y establezca la propiedad "AndroidUseAapt2" de MSBuild en "true".]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

Localize/loc/fr/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[L'utilisation d'AAPT est dépréciée en faveur d'AAPT2. Activez 'Utiliser le système d'empaquetage Android incrémentiel (aapt2)' dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte et définissez la propriété MSBuild 'AndroidUseAapt2' sur 'true'.]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[L’utilisation d’AAPT n’est pas prise en charge dans .NET pour les projets Android qui ciblent .NET 6 ou une version ultérieure. Activez 'Utiliser le système d'empaquetage Android incrémentiel (aapt2)' dans les pages de propriétés de projet Visual Studio, ou modifiez le fichier projet dans un éditeur de texte, puis affectez la valeur 'true' à la propriété MSBuild 'AndroidUseAapt2'.]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

Localize/loc/it/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[L'uso di AAPT è deprecato. In sostituzione verrà usato AAPT2. Abilitare 'Usa sistema di creazione pacchetti Android incrementale (AAPT2)' nelle pagine delle proprietà del progetto di Visual Studio o modificare il file di progetto in un editor di testo e impostare la proprietà 'AndroidUseAapt2' di MSBuild su 'true'.]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[L'uso di AAPT non è supportato in progetti .NET per Android destinati a .NET 6 o versione successiva. Abilitare 'Usa sistema di creazione pacchetti Android incrementale (AAPT2)' nelle pagine delle proprietà del progetto di Visual Studio o modificare il file di progetto in un editor di testo e impostare la proprietà 'AndroidUseAapt2' di MSBuild su 'true'.]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

Localize/loc/ja/src/Xamarin.Android.Build.Tasks/Properties/Resources.resx.lcl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -684,27 +684,6 @@
684684
</Str>
685685
<Disp Icon="Str" />
686686
</Item>
687-
<Item ItemId=";XA1026" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
688-
<Str Cat="Text">
689-
<Val><![CDATA[Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
690-
<Tgt Cat="Text" Stat="Loc" Orig="New">
691-
<Val><![CDATA[AAPT の使用は非推奨になり、AAPT2 を使用するようになりました。Visual Studio プロジェクトのプロパティ ページで [インクリメンタル Android パッケージ システム (aapt2) を使用します]5D; を有効にするか、テキスト エディターでプロジェクト ファイルを編集して 'AndroidUseAapt2' MSBuild プロパティを 'true' に設定してください。]]></Val>
692-
</Tgt>
693-
</Str>
694-
<Disp Icon="Str" />
695-
</Item>
696-
<Item ItemId=";XA1026_dotnet" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
697-
<Str Cat="Text">
698-
<Val><![CDATA[Using AAPT is not supported in .NET for Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
699-
<Tgt Cat="Text" Stat="Loc" Orig="New">
700-
<Val><![CDATA[.NET 6 以降を対象とする .NET for Android プロジェクトでは、AAPT の使用はサポートされていません。Visual Studio プロジェクトのプロパティ ページで [インクリメンタル Android パッケージ システム (aapt2) を使用する]5D; を有効にするか、テキスト エディターでプロジェクト ファイルを編集して 'AndroidUseAapt2' MSBuild プロパティを 'true' に設定してください。]]></Val>
701-
</Tgt>
702-
<Prev Cat="Text">
703-
<Val><![CDATA[Using AAPT is not supported in .NET Android projects that target .NET 6 or higher. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.]]></Val>
704-
</Prev>
705-
</Str>
706-
<Disp Icon="Str" />
707-
</Item>
708687
<Item ItemId=";XA1027" ItemType="0;.resx" PsrId="211" InstFlg="true" Leaf="true">
709688
<Str Cat="Text">
710689
<Val><![CDATA[The 'EnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.]]></Val>

0 commit comments

Comments
 (0)