Skip to content

Releases: dotnet/android

Xamarin.Android 9.1.103.7

23 Jan 21:21
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.1.103.7 was released as part of Visual Studio 2019 Preview 2.

What's New

Build and Deployment Performance Improvements

This release includes several more improvements to build and deployment times compared to Visual Studio 2017 version 15.9. For example, in a test development environment, the incremental build time after modifying one XAML page in the SmartHotel360 sample app has dropped from 8.5 seconds to 7.5 seconds and the corresponding deployment time has dropped from 5 seconds to 4.5 seconds.

See also:

  • The Build Performance Results page on the project wiki for additional comparisons and updates about the on-going work to continue to improve performance.
  • The latest numbers from the continuous integration builds.

Specific Improvements in Xamarin.Android 9.1.103.7

  • GitHub PR 2223: Optimize the default $(AssemblySearchPaths) and $(AllowedReferenceAssemblyFileExtensions) MSBuild properties by removing locations and extension types that are never used for Xamarin.Android projects. This improved the incremental build time by approximately 0.5 seconds for a test project that references 7 other Xamarin.Android projects.
  • GitHub PR 2308, GitHub PR 2320, GitHub PR 2326: Correct how several targets handle and update the timestamps of their Outputs. This prevents some scenarios where incremental builds could get stuck in a state where they would always rebuild the affected targets.
  • GitHub PR 2309: Remove unused Inputs and Outputs from several targets. This improved the total build time for those targets in a test project by a few dozen milliseconds.
  • GitHub PR 2328: Add the RegexOptions.Compiled option to a Regex and change some LINQ expressions to loops in the ConvertResourcesCases task. This improved the total time for the task in a test project by a few hundred milliseconds.
  • GitHub PR 2348: Allow the ConvertResourcesCases task to skip a specific set of "well-known" assemblies by name. For example, after this change, ConvertResourcesCases now skips all of the Xamarin.Android.Support, Xamarin.GooglePlayServices, and Xamarin.Firebase assemblies because those assemblies are built by the Xamarin team and never contain resource names that need to be converted. This can save 1 second or more for both initial clean builds and incremental builds after resource changes. The time saved depends on how many of these assemblies are used by the project.
  • GitHub PR 2384: Adjust the ResolveSdks task to cache the detected location of the JVM. This improved the incremental build time for a test project by a few hundred milliseconds.
  • GitHub PR 2394: Improve the incremental build behavior of the _ConvertPdbFiles, _CopyPdbFiles, and _CopyMdbFiles targets by correcting the Outputs so the timestamps are only updated if the contents have changed and by fixing an issue where duplicate copies of items were being added to @(FileWrites) on each build.
  • GitHub PR 2428: Save the $(AdbTarget) and $(AdbOptions) MSBuild properties in their own file rather than in the build.props file to prevent the deployment process from re-running unnecessary build targets when the deployment target has just been changed from emulator to device or from one device to another.
  • GitHub PR 2487: Change the LinkAssemblies task so that it checks for .mdb files with File.Exists() before it tries to access them. This avoids some exception handling overhead, reducing the total time for the task by a couple dozen milliseconds.
  • GitHub PR 2535: Adjust the GenerateJavaStubs and GenerateResourceDesigner tasks to perform generation and comparison in-memory rather than in temporary files, and make a few additional efficiency improvements in the GenerateJavaStubs task. This improved the initial clean build time for a test project by a few hundred milliseconds.
  • GitHub PR 2540: Adjust the ResolveLibraryProjectImports task to avoid allocating an intermediate byte[] and to avoid generating intermediate temporary files. This improved the total time for the task by a few dozen milliseconds.

App Performance Improvements

  • GitHub PR 2473: Avoid allocating or evaluating unused arguments in the primitive logging functions. This can reduce application startup time by a couple dozen milliseconds, depending on the target device.
  • GitHub PR 2500: Skip attempting to load the Java.Interop.Export.dll assembly during app startup because that part of the Java.Interop library is not used by Xamarin.Android. This can reduce application startup time by roughly 100 milliseconds, depending on the target device.

Support for the New Android DEX Compiler D8

The March 2018 release of the Android SDK introduced a new DEX compiler D8 that improves both compile times and app performance compared to the previous compiler DX. Xamarin.Android 9.2 updates the Xamarin.Android build tasks to be compatible with D8. Because D8 is not yet widely used by Xamarin.Android projects, it is not yet enabled by default. To try it with your project, set the $(AndroidDexTool) MSBuild property to d8 in your .csproj file:

<PropertyGroup>
    <AndroidDexTool>d8</AndroidDexTool>
</PropertyGroup>

For additional details about D8 in the context of Xamarin.Android, including a few comparisons of build speeds and sizes, see the integration specification notes.

Support for the New Android Code Shrinker R8

Recent versions of the Android SDK also include a preview of a new code shrinker R8 that aims to produce smaller DEX files more quickly than ProGuard. Xamarin.Android does not yet enable R8 by default. To try it with your project, set the $(AndroidLinkTool) MSBuild property to r8 in your .csproj file:

<PropertyGroup>
    <AndroidLinkTool>r8</AndroidLinkTool>
</PropertyGroup>

For additional details about R8 in the context of Xamarin.Android, including a few comparisons of build speeds and sizes, see the integration specification notes.

Enhanced Fast Deployment

[Fast Deployment][fast-deployment] has historically provided faster incremental deployment times by skipping rebuilding or redeploying the Android package (APK) when there have been no changes to the AndroidManifest.xml file or to any assets, resources, shared native libraries packaged within the app, or user-defined classes that inherit from Java.Lang.Object.

Xamarin.Android 9.2 enhances fast deployment so that it now supports most of those previously unsupported scenarios except for changes to the AndroidManifest.xml file. For example, adding a new Android layout file or a new user-defined class that inherits from Java.Lang.Object now no longer require the APK to be rebuilt or redeployed.

This new enhanced fast deployment mode is not yet enabled by default in the current preview. To try it with your project, set the $(AndroidFastDeploymentType) MSBuild property to Assemblies:Dexes in your .csproj file:

<PropertyGroup>
    <AndroidFastDeploymentType>Assemblies:Dexes</AndroidFastDeploymentType>
</PropertyGroup>

For any users who might have tried the earlier experimental version of this feature [introduced in Xamarin.Android 7.0][7-0-fast-deployment], note that this new version solves the [incompatibility with cus...

Read more

Xamarin.Android 9.1.5.1

19 Jan 00:48
2cc615a
Compare
Choose a tag to compare

Xamarin.Android 9.1.5.0 was released as part of Visual Studio 2017 for Mac version 7.7.3.

Issues Fixed

  • The Xamarin.Android installer package for macOS caused a dialog "To use the
    'java' command-line tool you need to install a JDK." to appear after
    installation if the Microsoft Mobile OpenJDK Distribution was the
    only installed JDK.

Xamarin.Android 9.1.5.0

08 Jan 19:59
2cc615a
Compare
Choose a tag to compare

Xamarin.Android 9.1.5.0 was released as part of Visual Studio 2017 version 15.9.5.

Issues Fixed

  • GitHub 2257: Apps that referenced hundreds of assemblies would quit unexpectedly during startup because they consumed too many JNI local references: "JNI ERROR (app bug): local reference table overflow (max=512)". The local references are now released more aggressively, allowing this kind of app to run successfully.
  • GitHub 2408: The @(AndroidAarLibrary) Build Action could lead to errors about missing resources during incremental builds. This particular cause of errors about missing resources should not have affected many users yet because the @(AndroidAarLibrary) build action is primarily intended for future use in Android library bindings NuGet packages published by the Xamarin team.

Xamarin.Android 9.1.4.2

12 Dec 18:51
Compare
Choose a tag to compare

Xamarin.Android 9.1.4.2 was released as part of Visual Studio 2017 version 15.9.4 and Visual Studio 2017 for Mac version 7.7.

See the release notes for additional details.

Xamarin.Android 9.1.0.37

24 Oct 19:41
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.1.0.37 was released as part of Visual Studio 15.9 Preview 4.

Xamarin.Android 9.1.101.6

06 Dec 22:57
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.1.101.6 was released as part of Visual Studio 2019 Preview 1 and Visual Studio 2019 for Mac Preview 1.

Xamarin.Android 9.0.0.0.

03 Jul 19:43
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.0.0.0 was released as part of Visual Studio 15.8 Preview 4.