Xamarin.Android 13.2 release notes

| GitHub | Developer Community | System requirements | Blogs |

Installing

Xamarin.Android 13.2 releases are distributed as part of Visual Studio 2022 17.5 and later.

What's new in Xamarin.Android 13.2

Xamarin.Android 13.2 releases

Xamarin.Android version 13.2.2.0

Released October 10, 2023, and included in Visual Studio 2022 version 17.8 Preview 3, and Visual Studio for Mac 17.6.

Xamarin.Android 13.2.2.0 has two significant changes:

  1. It can use JDK 17
  2. It can target API-34

JDK-17 Support

JDK-17 can now be used to build Xamarin.Android apps.

API-34 can be targeted

Xamarin.Android 13.2.2.0 does not bind API-34; you cannot use Android types or methods introduced in API-34 such as android.credentials.Credential. To use types and methods introduced in API-34, use the .NET 8 SDK for Android.

Xamarin.Android 13.2.2.0 allows you to target API-34, by setting the //uses-sdk/@android:targetSdkVersion attribute to 34:

<uses-sdk minSdkVersion="21" targetSdkVersion="34" />

Setting the targetSdkVersion attribute to 34 will allow your app to be submitted to and/or updated in the Google Play Store after 2024-Aug-31.

Note: setting the targetSdkVersion attribute to 34 may result in XA1008 warnings:

…/Xamarin.Android.Legacy.targets(348,5): warning XA1008: The TargetFrameworkVersion (Android API level 33) is lower than the targetSdkVersion (34).
Please increase the `$(TargetFrameworkVersion)` or decrease the `android:targetSdkVersion` in the `AndroidManifest.xml` so that the API levels match.

The XA1008 warning may be safely ignored.

Xamarin.Android version 13.2.1.2

Released August 8, 2023, and included in Visual Studio 2022 version 17.7, Visual Studio 17.8 Preview 1, and Visual Studio for Mac 17.6.

We recommend that all users upgrade to Xamarin.Android 13.2.1.2, rebuild, and resubmit their apps to the Google Play Store and other stores before Android 14 is released in late 2023.

TimeZoneInfo support on Android 14

Fix Debugging on Android 9

Xamarin.Android verison 13.2.0.6

Released June 20, 2023, and included in Visual Studio 2022 version 17.6.

Fix debugging of System apps

External Dependency Bumps

Runtime Fixes

Xamarin.Android version 13.2.0.0

Released February 21, 2023, and included in Visual Studio 2022 version 17.5.

External Dependency Bumps

Runtime Fixes

Build Fixes

  • Bump to xamarin/monodroid/main@135be73
    (PR #7384, Commit 3269e51a) Various Fast Deployment fixes.

  • Handle Empty R.txt file.
    (Issue #1439405, PR #7133, Commit 57f280c5)

    ManagedResourceParser would assume that R.txt would contain four entries space-delimited entries per line, e.g.

    int layout main 0x7f030000
    

    If ManagedResourceParser encountered a line that didn't have four space-delimited entries, then it would crash:

    System.IndexOutOfRangeException: Index was outside of bounds of the array.
       as Xamarin.And.Tasks.ManagedResourceParser.ProcessRtxtFile (System.String file)
    
  • Use ProGuard config files from .aar files.
    (Issue #3752, PR #5310, Commit c537dd28)

  • Use binutils for Aot and LLVM
    (PR #6901, Commit 346a9330)

  • $(AndroidLinkResources) and Styleables
    (Issue #7194, PR #7306, Commit d521ac02)

    See also dotnet/maui#7038.

    The initial version of $(AndroidLinkResources) was too broad in its removal of Resource classes and fields. Certain fields such as Styleable arrays were not called using the IL stsfld opcode. As a result they could not be easily replaced with constant usage.

    However, the linker removed all the fields from the Resource nested types. This would result in the following error at runtime:

    System.BadImageFormatException: 'Could not resolve field token 0x0400000b'
    

    This was because the int[] fields were removed as part of the linking process.

    Fix this by leaving the int[] fields in the Resource nested types instead of removing them.

    We can still remove all the other int fields.

  • Add @(AndroidPackagingOptionsExclude)
    (Issue #6920, PR #7356, Commit 2726a386)

    Certainly NuGet packages pull in Kotlin-related artifacts which aren't required at runtime. These artifacts contribute to .apk package size.

    Add support for a new @(AndroidPackagingOptionsExclude) item group. This contains a "search pattern" similar to the searchPattern parameter of Directory.EnumerateFiles(path, searchPattern), in which:

    • * matches 0 or more characters
    • ? matches 1 character.

    The default items within @(AndroidPackagingOptionsExclude) are:

    • DebugProbesKt.bin
    • *.kotlin_*

    Files which match the search patterns within @(AndroidPackagingOptionsExclude) are excluded from .aab and .apk files, reducing app size.

  • Avoid XA5207 for design-time builds
    (Issue #7405, PR #7434, Commit 5044377a)

  • Fix aapt_rules.txt corruption
    (Issue #7447, PR #7587, Commit 6383b4e9)

    When building a project with $(AndroidCreatePackagePerAbi)=True, the build may fail with:

    MSBUILD : java.exe error JAVA0000: Error in obj\Release\110\aapt_rules.txt at line 289, column 1: [C:\Jenkins\workspace\Demo\Demo.Android\Demo.Android.csproj]
    MSBUILD : java.exe error JAVA0000: Expected char '-' at obj\Release\110\aapt_rules.txt:289:1 [C:\Jenkins\workspace\Demo\Demo.Android\Demo.Android.csproj]
    MSBUILD : java.exe error JAVA0000: nit>(...); } [C:\Jenkins\workspace\Demo\Demo.Android\Demo.Android.csproj]
    MSBUILD : java.exe error JAVA0000: Compilation failed
    

    Fix this file corruption.

Feedback welcome

Your feedback is important to us. If there are any problems with this release, check our GitHub Issues, Xamarin.Android Community Forums and Visual Studio Developer Community for existing issues. For new issues within the Xamarin.Android SDK, please report a GitHub Issue. For general Xamarin.Android experience issues, let us know via the Report a Problem option found in your favorite IDE under Help > Report a Problem.

Open source

Xamarin.Android 13.2 is based on the open-source Xamarin.Android repositories: