Skip to content

Commit 3607637

Browse files
committed
[Xamarin.Android.Build.Tasks] Add support for '<AndroidNamespaceReplacement>'.
1 parent 32cff43 commit 3607637

File tree

20 files changed

+170
-0
lines changed

20 files changed

+170
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Xamarin.Android error XA4233
3+
description: XA4232 error code
4+
ms.date: 01/25/2022
5+
---
6+
# Xamarin.Android error XA4233
7+
8+
## Example messages
9+
10+
```
11+
error XA4233: The <AndroidNamespaceReplacement> for 'com.xamarin.androidx' does not specify a 'Replacement' attribute.
12+
```
13+
14+
## Issue
15+
16+
`<AndroidNamespaceReplacement>` items must include `Replacement` attribute
17+
18+
## Solution
19+
20+
To resolve this error, ensure that the specified `<AndroidNamespaceReplacement>` contains
21+
a 'Replacement' aatribute:
22+
23+
```xml
24+
<ItemGroup>
25+
<AndroidNamespaceReplacement Include="com.xamarin.androidx" Replacement="Xamarin.AndroidX" />
26+
</ItemGroup>
27+
```
28+
29+
Note it is valid for the `Replacement` attribute value to be empty, however the attribute must still be provided:
30+
31+
```xml
32+
<ItemGroup>
33+
<AndroidNamespaceReplacement Include="com." Replacement="" />
34+
</ItemGroup>
35+
```

src/Xamarin.Android.Build.Tasks/MSBuild/Xamarin/Android/Xamarin.Android.Bindings.Core.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ It is shared between "legacy" binding projects and .NET 5 projects.
8181
EnableBindingInterfaceConstants="$(AndroidBoundInterfacesContainConstants)"
8282
Nullable="$(Nullable)"
8383
UseJavaLegacyResolver="$(_AndroidUseJavaLegacyResolver)"
84+
NamespaceTransforms="@(AndroidNamespaceReplacement)"
8485
/>
8586

8687
<!-- Write a flag so we won't redo this target if nothing changed -->

src/Xamarin.Android.Build.Tasks/Properties/Resources.resx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,4 +864,9 @@ In this message, the term "handheld app" means "app for handheld devices."
864864
</value>
865865
<comment>{0} - The path of the template file.</comment>
866866
</data>
867+
<data name="XA4233" xml:space="preserve">
868+
<value>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</value>
869+
<comment>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
870+
{0} - The AndroidNamespaceReplacement MSBuild value.</comment>
871+
</data>
867872
</root>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.cs.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.de.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.es.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.fr.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.it.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ja.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

src/Xamarin.Android.Build.Tasks/Properties/xlf/Resources.ko.xlf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ The capitalized word "Portable" that appears earlier in the message is plain tex
6969
<target state="new">The 'AndroidEnableProguard' MSBuild property is set to 'true' and the 'AndroidLinkTool' MSBuild property is empty, so 'AndroidLinkTool' will default to 'proguard'.</target>
7070
<note>The following are literal names and should not be translated: 'AndroidEnableProguard', 'true', 'AndroidLinkTool', 'proguard'</note>
7171
</trans-unit>
72+
<trans-unit id="XA4233">
73+
<source>The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</source>
74+
<target state="new">The &lt;AndroidNamespaceReplacement&gt; for '{0}' does not specify a 'Replacement' attribute.</target>
75+
<note>The following are literal names and should not be translated: &lt;AndroidNamespaceReplacement&gt;
76+
{0} - The AndroidNamespaceReplacement MSBuild value.</note>
77+
</trans-unit>
7278
<trans-unit id="XA4300">
7379
<source>Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</source>
7480
<target state="new">Native library '{0}' will not be bundled because it has an unsupported ABI. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.</target>

0 commit comments

Comments
 (0)