Skip to content

Commit

Permalink
Merge branch 'main' into dev/grendel/blobs-in-lib
Browse files Browse the repository at this point in the history
* main:
  [Xamarin.Android.Build.Tasks] XA1039 error for Android.Support (#8629)
  • Loading branch information
grendello committed Jan 18, 2024
2 parents 04c1d8d + 2f19238 commit b4a57c4
Show file tree
Hide file tree
Showing 7 changed files with 222 additions and 171 deletions.
47 changes: 47 additions & 0 deletions Documentation/guides/messages/xa1039.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Xamarin.Android error XA1039
description: XA1039 error code
ms.date: 1/10/2024
---
# Xamarin.Android error XA1039

## Example messages

```
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.
```

## Issue

Outdated "Android Support Library" packages are no longer supported in .NET 9:

* `Xamarin.Android.Arch.*`
* `Xamarin.Android.Support.*`

The underlying Java libraries are no longer supported by Google since the final
28.0.0 release. See the [Android Support Library Documentation][support] for
details.

Some example prefixes of the newer, supported AndroidX packages are:

* `Xamarin.AndroidX.*`
* `Xamarin.AndroidX.Arch.*`

For more information about the Android Support libraries or AndroidX, see:

* [Android Support Library Documentation][support]
* [AndroidX Documentation](https://developer.android.com/jetpack/androidx)

[support]: https://developer.android.com/topic/libraries/support-library/packages

## Solution

Remove all NuGet package references to `Xamarin.Android.Support` or
`Xamarin.Android.Arch` in favor of the new AndroidX equivalents.

This also can occur if you are using a NuGet package with a transitive
dependency on the Android support packages. In this case, you will need to
remove the package or contact the package author.

See the [AndroidX migration documentation](https://aka.ms/xamarin/androidx) for
details.
7 changes: 3 additions & 4 deletions src/Xamarin.Android.Build.Tasks/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,7 @@ To use a custom JDK path for a command line build, set the 'JavaSdkDirectory' MS
{1} - The numeric version of .NET</comment>
</data>
<data name="XA1039" xml:space="preserve">
<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>
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.
{0} - The numeric version of .NET</comment>
<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>
<comment>The following are literal names and should not be translated: Android Support, AndroidX, .NET.</comment>
</data>
</root>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public void CheckEmbeddedAndroidXResources ()
var proj = new XamarinAndroidApplicationProject () {
IsRelease = true,
PackageReferences = {
KnownPackages.AndroidXAppCompat
KnownPackages.AndroidXAppCompat,
},
};
using (var b = CreateApkBuilder ()) {
Expand Down Expand Up @@ -823,7 +823,7 @@ public void CheckFilesAreRemoved () {
</style>
</resources>",
}
}
},
};
using (var builder = CreateApkBuilder ()) {
Assert.IsTrue (builder.Build (proj), "Build should have succeeded");
Expand Down Expand Up @@ -1022,7 +1022,7 @@ public void BuildAppWithManagedResourceParserAndLibraries ()
new BuildItem.ProjectReference (@"..\Lib1\Lib1.csproj", libProj.ProjectName, libProj.ProjectGuid),
},
PackageReferences = {
KnownPackages.AndroidXAppCompat
KnownPackages.AndroidXAppCompat,
},
};
appProj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "True");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ public void MergeLibraryManifest ()
new BuildItem.ProjectReference ("..\\Binding1\\Binding1.csproj", lib.ProjectGuid)
},
PackageReferences = {
KnownPackages.AndroidXAppCompat
KnownPackages.AndroidXAppCompat,
},
};
proj.SetProperty ("AndroidManifestMerger", "legacy");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ public void CheckIncludedFilesArePresent ()
public void BuildApkWithZipFlushLimits (int filesLimit, int sizeLimit)
{
var proj = new XamarinFormsAndroidApplicationProject {
IsRelease = false
IsRelease = false,
};
proj.SetProperty ("EmbedAssembliesIntoApk", "true");
if (filesLimit > 0)
Expand Down
Loading

0 comments on commit b4a57c4

Please sign in to comment.