Xamarin v10.3.99.230 Release Notes

Release Date: 2020-05-19 // almost 4 years ago
  • May 19, 2020 โ€” Xamarin.Android 10.3.99.230 was published as part of Visual Studio 2019 version 16.7 Preview 1 and Visual Studio 2019 for Mac version 8.7 Preview 1.

    ๐Ÿš€ Corresponding Visual Studio 2019 Preview release notes

    What's new

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

    ๐Ÿš€ Build and deployment performance

    • ๐Ÿ— GitHub PR 4190: Switch to running AAPT2 in single-file mode rather than --dir mode. This reduced the total incremental build time from about 16.4 seconds to about 5.5 seconds for a test project when a single Android resource file was changed between builds.
    • โšก๏ธ Java.Interop GitHub PR 624, Java.Interop GitHub PR 627, Java.Interop GitHub PR 628: Update the CRC-64 algorithm used during builds to take advantage of a more efficient calculation technique. This reduced the total incremental build time from about 8.7 seconds to about 8.5 seconds for a small Xamarin.Forms app when one line of a C# file was changed between builds.

    Mono.Android nullable reference types compatibility

    The Mono.Android assembly has been annotated for compatibility with C# 8.0 nullable reference type checks. Projects can now optionally place code that uses types from Mono.Android in a nullable context to take advantage of additional compiler nullability checks. For example, to enable nullability checks for all code in a project, set the Nullable MSBuild property to enable in the .csproj file:

    \<PropertyGroup\> \<Nullable\>enable\</Nullable\> \</PropertyGroup\>
    

    ๐Ÿ— When this property set, the build will emit warnings if any code does not properly account for possible null values passed into or returned from APIs in the Mono.Android assembly.

    ๐Ÿ“š See the nullable reference types documentation for more information.

    Note: The majority of Mono.Android, including the nullability annotations, is automatically generated from the Android Java source. The annotations intentionally preserve any upstream bugs in the nullability information provided by the Android source code.

    Tidier IntelliSense suggestions for Java.Lang.Object subclasses

    ๐Ÿ‘ Java.Lang.Object contains several properties and methods that are required to be public to support Xamarin.Android Java bindings but are not intended to be used in hand-written code. These members are now hidden from IntelliSense, making it easier to find the useful members.

    Example IntelliSense suggestions before and after

    ๐Ÿ—„ Bindings projects XA4231 and XA4232 warnings for deprecated settings

    ๐Ÿ—„ XA4231 warning for deprecated jar2xml parser

    ๐Ÿ— Any bindings project that has the AndroidClassParser MSBuild property set to the old jar2xml parser or any other unrecognized value will now get a XA4231 build warning:

    warning XA4231: The Android class parser 'jar2xml' is deprecated and will be removed in a future version of Xamarin.Android. Update the project properties to use 'class-parse' instead.
    

    ๐Ÿ“œ To resolve this warning, update the Android Class Parser setting in the Visual Studio project property pages or the .jar file parser setting in Visual Studio for Mac to class-parse. This corresponds to the class-parse value for the AndroidClassParser MSBuild property in the .csproj file:

    \<PropertyGroup\> \<AndroidClassParser\>class-parse\</AndroidClassParser\> \</PropertyGroup\>
    

    ๐Ÿ—„ XA4232 warning for deprecated XamarinAndroid code generation target

    ๐Ÿ— Any bindings project that has the AndroidCodegenTarget MSBuild property set to the old XamarinAndroid code generation target or any other unrecognized value will now get a XA4232 build warning:

    warning XA4232: The Android code generation target value 'XamarinAndroid' is deprecated and will be removed in a future version of Xamarin.Android. Update the project properties to use 'XAJavaInterop1'.
    

    To resolve this warning, update the Android Codegen target setting in the Visual Studio project property pages or the Code generation target setting in Visual Studio for Mac to XAJavaInterop1. This corresponds to the XAJavaInterop1 value for the AndroidCodegenTarget MSBuild property in the .csproj file:

    \<PropertyGroup\> \<AndroidCodegenTarget\>XAJavaInterop1\</AndroidCodegenTarget\> \</PropertyGroup\>
    

    ๐Ÿ›  Issues fixed in Xamarin.Android 10.3.99.230

    ๐Ÿš€ Application and library build and deployment

    • GitHub 2042: The Mono.Android assembly did not yet surface the nullability information provided by the upstream Android source code for use in C# 8.0 nullable contexts.
    • ๐Ÿš€ GitHub 4439: Invalid values of the AndroidDexTool MSBuild property produced a misleading error during deployment instead of an error during the build. Invalid values are now ignored and the default D8 DEX tool is used instead.
    • GitHub PR 4578: The source directory is under the output directory. Skip it. build error did not yet mention the relevant MSBuild item type or the current path of the invalid item.
    • โš  Java.Interop GitHub PR 622: warning : Failed to read ... with debugging symbols. Retrying to load it without it. and Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly could appear during builds, for example for projects using obfuscation tools. To align more closely with the behavior of other common .NET project types that do not warn about mismatched debugger symbols, Xamarin.Android projects now log these as informational messages instead of warnings.

    ๐Ÿ— Design-time builds

    • โšก๏ธ Developer Community 896179, GitHub 4273: The IDE could become unresponsive for tens of seconds after changes were saved to an Android layout file in projects configured to use AAPT2.

    Bindings projects

    • GitHub PR 4579: Unrecognized transform root element build error did not yet mention the relevant MSBuild item type.
    • GitHub PR 4579: Specified source jar not found and Specified reference jar not found build errors did not yet mention Java library types other than JAR files.
    • ๐Ÿ— Java.Interop GitHub PR 611: Building a binding project that had a reference to another binding project performed some redundant work for assemblies referenced by both projects.

    Application Mono Framework behavior on device and emulator

    ๐Ÿš€ This version of Xamarin.Android updates the Mono 6.12 runtime and class libraries from Commit 165f4b03 to Commit 051408e0, adding 5 new commits.

    ๐Ÿ›  Fixes included for issues reported with Xamarin.Android applications:

    IDE compatibility

    • GitHub 4582: Some Java.Lang.Object properties and methods like Handle and PeerReference appeared in IntelliSense suggestions even though they were primarily intended for use only in generated code.

    Known issues in Xamarin.Android 10.3.99.230

    • Developer Community 1024028, GitHub 4596, GitHub 4660: System.MemberAccessException: Cannot create an instance of ... can cause apps to abort when attempting to use certain APIs that have both generic and non-generic versions. This issue will be resolved in a future preview version.

    Thank you

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

    Installing

    โšก๏ธ To get the new version in Visual Studio, update Visual Studio:

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

    Open source

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