Skip to content

Commit b4a57c4

Browse files
committed
Merge branch 'main' into dev/grendel/blobs-in-lib
* main: [Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629)
2 parents 04c1d8d + 2f19238 commit b4a57c4

File tree

7 files changed

+222
-171
lines changed

7 files changed

+222
-171
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: Xamarin.Android error XA1039
3+
description: XA1039 error code
4+
ms.date: 1/10/2024
5+
---
6+
# Xamarin.Android error XA1039
7+
8+
## Example messages
9+
10+
```
11+
error XA1039: The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.
12+
```
13+
14+
## Issue
15+
16+
Outdated "Android Support Library" packages are no longer supported in .NET 9:
17+
18+
* `Xamarin.Android.Arch.*`
19+
* `Xamarin.Android.Support.*`
20+
21+
The underlying Java libraries are no longer supported by Google since the final
22+
28.0.0 release. See the [Android Support Library Documentation][support] for
23+
details.
24+
25+
Some example prefixes of the newer, supported AndroidX packages are:
26+
27+
* `Xamarin.AndroidX.*`
28+
* `Xamarin.AndroidX.Arch.*`
29+
30+
For more information about the Android Support libraries or AndroidX, see:
31+
32+
* [Android Support Library Documentation][support]
33+
* [AndroidX Documentation](https://developer.android.com/jetpack/androidx)
34+
35+
[support]: https://developer.android.com/topic/libraries/support-library/packages
36+
37+
## Solution
38+
39+
Remove all NuGet package references to `Xamarin.Android.Support` or
40+
`Xamarin.Android.Arch` in favor of the new AndroidX equivalents.
41+
42+
This also can occur if you are using a NuGet package with a transitive
43+
dependency on the Android support packages. In this case, you will need to
44+
remove the package or contact the package author.
45+
46+
See the [AndroidX migration documentation](https://aka.ms/xamarin/androidx) for
47+
details.

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,7 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
10071007
{1} - The numeric version of .NET</comment>
10081008
</data>
10091009
<data name="XA1039" xml:space="preserve">
1010-
<value>The Android Support libraries are no longer supported in .NET {0}, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.</value>
1011-
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.
1012-
{0} - The numeric version of .NET</comment>
1010+
<value>The Android Support libraries are not supported in .NET 9 and later, please migrate to AndroidX. See https://aka.ms/xamarin/androidx for more details.</value>
1011+
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.</comment>
10131012
</data>
1014-
</root>
1013+
</root>

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void CheckEmbeddedAndroidXResources ()
143143
var proj = new XamarinAndroidApplicationProject () {
144144
IsRelease = true,
145145
PackageReferences = {
146-
KnownPackages.AndroidXAppCompat
146+
KnownPackages.AndroidXAppCompat,
147147
},
148148
};
149149
using (var b = CreateApkBuilder ()) {
@@ -823,7 +823,7 @@ public void CheckFilesAreRemoved () {
823823
</style>
824824
</resources>",
825825
}
826-
}
826+
},
827827
};
828828
using (var builder = CreateApkBuilder ()) {
829829
Assert.IsTrue (builder.Build (proj), "Build should have succeeded");
@@ -1022,7 +1022,7 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
10221022
new BuildItem.ProjectReference (@"..\Lib1\Lib1.csproj", libProj.ProjectName, libProj.ProjectGuid),
10231023
},
10241024
PackageReferences = {
1025-
KnownPackages.AndroidXAppCompat
1025+
KnownPackages.AndroidXAppCompat,
10261026
},
10271027
};
10281028
appProj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "True");

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ public void MergeLibraryManifest ()
763763
new BuildItem.ProjectReference ("..\\Binding1\\Binding1.csproj", lib.ProjectGuid)
764764
},
765765
PackageReferences = {
766-
KnownPackages.AndroidXAppCompat
766+
KnownPackages.AndroidXAppCompat,
767767
},
768768
};
769769
proj.SetProperty ("AndroidManifestMerger", "legacy");

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ public void CheckIncludedFilesArePresent ()
634634
public void BuildApkWithZipFlushLimits (int filesLimit, int sizeLimit)
635635
{
636636
var proj = new XamarinFormsAndroidApplicationProject {
637-
IsRelease = false
637+
IsRelease = false,
638638
};
639639
proj.SetProperty ("EmbedAssembliesIntoApk", "true");
640640
if (filesLimit > 0)

0 commit comments

Comments
 (0)