Xamarin v11.1.99.168 Release Notes

Release Date: 2020-11-10 // over 3 years ago
  • What's new in Xamarin.Android 11.2

    November 10, 2020 โ€” Xamarin.Android was published as part of Visual Studio 2019 version 16.9 Preview 1 and Visual Studio 2019 for Mac version 8.9 Preview 1.

    ๐Ÿš€ Corresponding Visual Studio 2019 Preview release notes

    What's new

    ๐Ÿ”ง Deprecations, removals, and default configuration changes

    ๐Ÿš€ Build and deployment performance

    ๐ŸŽ GitHub PR 5188: Improve performance by lazily loading an Android resource mapping file that is only used for error messages. This reduced the overall build time by 348 milliseconds in a real-world project in an initial clean build or incremental builds with Android resource changes.

    ๐Ÿš€ Rewritten fast deployment system

    ๐Ÿš€ As part of this update, the fast deployment system used for Debugging apps has been changed. The shared runtime and shared platform packages are no longer used or required.

    The new system also no longer uses the external drive for the fast deployment files. All of the files and tooling are now stored in the application's internal directory. This has an advantage in that when the application is uninstalled, all of the files and the tooling will be removed as well.

    ๐Ÿ‘ The new system will not work on any devices older than Android 5.0 Lollipop (API level 21). This is because it relies on features that only work from API level 21 onwards. Also API level 21 is the lowest supported platform for the runtime, so running and debugging on older devices will be impossible.

    ๐Ÿ“š See Documentation for more details.

    ๐Ÿ—„ Deprecation of DebugType full and pdbonly

    warning XA0125: 'AndroidApp1.pdb' is using a deprecated debug
    information level. Set the debugging information to Portable in the
    Visual Studio project property pages or edit the project file in a
    text editor and set the 'DebugType' MSBuild property to 'portable' to
    use the newer, cross-platform debug information level. If this file
    comes from a NuGet package, update to a newer version of the NuGet
    package or notify the library author.

    Support for .mdb or .pdb symbols files that were built with the DebugType MSBuild property set to full or pdbonly is now deprecated. This applies to .mdb and .pdb files in application projects as well as in referenced libraries, including NuGet packages.

    ๐Ÿ Set DebugType to portable in the application project as well all library references. portable is the recommended setting for all projects from now on. The older full and pdbonly settings are for older Windows-specific file formats. .NET 6 and higher will not support those older formats.

    ๐Ÿ— In Visual Studio, go to Properties > Build > Advanced in the project property pages and change Debugging information to Portable.

    ๐Ÿ— In Visual Studio for Mac, go to Build > Compiler > Debug information in the project property pages and change Debug information to Portable.

    โšก๏ธ If the problematic symbol file comes from a NuGet package, update to a newer version of the package or notify the library author.

    ๐Ÿ—„ Deprecation of AAPT in favor of AAPT2

    warning XA1026: 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'.

    ๐Ÿ—„ Google has deprecated the AAPT command-line tool in favor of AAPT2 going forward. Xamarin.Android has accordingly now deprecated <AndroidUseAapt2>false</AndroidUseAapt2> as well.

    ๐Ÿ‘‰ Update the AndroidUseAapt2 MSBuild property to true to select AAPT2. This property corresponds to the Use incremental Android packaging system (aapt2) setting in the Visual Studio project properties pages. Alternatively, remove <AndroidUseAapt2> from the .csproj file to let the build select the default value true.

    Important : AAPT2 will in some cases enforce stricter rules on resource files than the previous AAPT, so some adjustments might be needed if you see new error messages that come from AAPT2 itself rather than from the Xamarin.Android build tasks.

    If needed, the --legacy switch can run AAPT2 in an AAPT compatibility mode. Add the following to your .csproj file:

    \<PropertyGroup\> \<AndroidAapt2CompileExtraArgs\>--legacy\</AndroidAapt2CompileExtraArgs\> \</PropertyGroup\>

    ๐Ÿ‘ Better file association for Android manifest syntax errors

    Syntax errors in AndroidManifest.xml previously always referred to the generated version of the file (like obj\Debug\90\android\manifest\AndroidManifest.xml), even for syntax errors that were also present in the manually configured input Properties\AndroidManifest.xml file. Android manifest errors are now fixed up to point to the Properties\AndroidManifest.xml file. The errors also now include a note to inform users that manifest generation attributes in source code files can be responsible for the errors in some cases.

    ๐Ÿ‘ Removal of ${library.imports:} support in AndroidResgenExtraArgs MSBuild property

    ๐Ÿšš A text templating feature for AAPT and AAPT2 has been removed that provided a workaround for the Amazon Fire Phone:

    \<AndroidResgenExtraArgs\>-I ${library.imports:eac-api.jar} -I ${library.imports:euclid-api.jar}\</AndroidResgenExtraArgs\>

    The ${library.imports:...} syntax should no longer be needed by modern Android libraries. .aar files are the recommended way for Java/Kotlin libraries to distribute Android resources to be consumed by Xamarin.Android application projects.

    ๐Ÿšš Note that the AndroidResgenExtraArgs and AndroidAapt2LinkExtraArgs MSBuild properties will continue to pass additional arguments to aapt and aapt2 link with the ${library.imports:...} syntax removed.

    ๐Ÿ‘ UseShortFileNames=false is no longer supported

    In previous versions of Xamarin.Android, you could set the UseShortFileNames MSbuild property in your .csproj file:

    \<PropertyGroup\> \<UseShortFileNames\>false\</UseShortFileNames\> \</PropertyGroup\>

    This would tell Xamarin.Android's MSBuild targets to use the "long" folder names such as:

    • obj\Debug\lp -> __library_projects__
    • obj\Debug\lp*\jl -> library_project_imports
    • obj\Debug\lp*\nl -> native_library_imports

    ๐Ÿ This was useful when UseShortFileNames was a new feature, giving developers a way to "opt out" if they hit a bug. However, UseShortFileNames has defaulted to true since around July 2017 to help with the Windows API maximum path length limitation.

    ๐Ÿšš This functionality has been removed from Xamarin.Android. Short file names will be used going forward.

    ๐Ÿ›  Notable issues fixed

    ๐Ÿš€ Application and library build and deployment

    Developer Community 1184573: Xamarin Android falsely saying that Resource does not exist in the current context (CS0103). Duplicate attr elements in declare-styleable styles were causing the design-time build system to crash. As a result the Resource.designer.cs was not being updated.

    Developer Community 1036602, GitHub Issue 5009: Starting in Xamarin.Android 10.2, .pdb files were not included in the APK if the managed linker was enabled.

    ๐Ÿš€ GitHub Issue 4996: application deploy on Android 11 emulator fails with Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission denied

    ๐Ÿ— Github PR 5107: Starting in Xamarin.Android 11.0, building solutions in parallel with msbuild YourSolution.sln -m could fail with errors such as:

    obj\Release\100\android\manifest\AndroidManifest.xml(7,0): error APT2260: resource mipmap/ic_launcher (aka com.companyname.skiasharpsample:mipmap/ic_launcher) not found.
    obj\Release\100\android\manifest\AndroidManifest.xml(7,0): error APT2260: resource string/app_name (aka com.companyname.skiasharpsample:string/app_name) not found.
    obj\Release\100\android\manifest\AndroidManifest.xml(7,0): error APT2260: resource mipmap/ic_launcher_round (aka com.companyname.skiasharpsample:mipmap/ic_launcher_round) not found.
    obj\Release\100\android\manifest\AndroidManifest.xml(9,0): error APT2260: resource style/MainTheme.Splash (aka com.companyname.skiasharpsample:style/MainTheme.Splash) not found.
    Xamarin.Android.Aapt2.targets(226,3): error APT2067: failed processing manifest.

    ๐Ÿ›  All enhancements and issues fixed in Xamarin.Android 11.2

    GitHub enhancements

    GitHub bugs

    ๐Ÿ›  Developer Community

    Other changes in Xamarin.Android 11.2

    Other changes

    Thank you

    A big _ Thank You! _ to community members who contributed improvements in this release:


    For other scenarios, the latest commercial .vsix and .pkg installer packages can be found in the project README.

    Open source

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