Skip to content

Releases: dotnet/android

Xamarin.Android 10.0.0.4

13 Aug 23:23
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 10.0.0.4 was released as part of Visual Studio 2019 version 16.3 Preview 2 and to the Preview updater channel of Visual Studio 2019 for Mac.

Corresponding Visual Studio 2019 Preview release notes

What's new

Bindings for Android Q Beta 4 with final APIs

Xamarin.Android 10.0 updates the bindings for Android Q to match the Android Q Beta 4 release from Google, which includes the final APIs for Android Q. See the Android Q Beta documentation for additional information about the behavior and API changes in this new Android version. To use the bindings for the new APIs in a Xamarin.Android project, set Compile using Android version: (Target Framework) to Android 10.0 (Q) under the Application tab of the Visual Studio project property pages.

Improved support for Android App Bundle publishing format

The previous limitation with the Install location when using the Android App Bundle Bundle publishing format is now resolved. Projects that have the $(AndroidPackageFormat) MSBuild property to aab that are built on the command line using the SignAndroidPackage MSBuild target now produce .aab packages compatible with any Install location. This resolves the following issue:

  • GitHub 3298: "JNI DETECTED ERROR IN APPLICATION: mid == null" or "CallStaticIntMethodV received NULL jclass" "... in call to CallStaticIntMethodV ... from void mono.android.Runtime.init" prevented apps packaged using the Android App Bundle publishing format and an Install location other than Internal Only from running successfully when installed via Google Play on devices running Android versions between 6.0 Marshmallow (API level 23) and 8.1 Oreo (API level 27).

The version of the bundletool executable included in Xamarin.Android has also been updated from 0.8.0 to 0.10.0, bringing in several improvements and bug fixes.

Mono Framework version update to 6.4

This version of Xamarin.Android updates the Mono runtime and class libraries from Mono 6.0 to Mono 6.4 Commit 17ac7dcf, adding about 1,500 new commits.

Issues fixed in Xamarin.Android 10.0.0.4

Application behavior on device and emulator

  • GitHub 3263: Errors similar to "System.TypeLoadException: Could not load type 'Android.Text.ITextWatcherInvoker' from assembly 'Mono.Android" would cause app execution to abort during calls to certain C# bindings for Android methods in apps built with the manager linker enabled.
  • GitHub 3314: "Java.Lang.Exception: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f080058" error would abort app execution on Android 4.4 KitKat (API level 19) or lower for apps built with AAPT2 that uses Android Support Libraries.

Application and library build process

  • GitHub 3237: In projects configured to use AAPT2, errors similar to "error CS0117: 'Resource' does not contain a definition for 'Layout'" could sometimes abort the build when attempting to build solutions with parallel builds enabled.
  • GitHub PR 3243: Warnings similar to "warning XA0106: Skipping AndroidApp.Resource.Drawable.avd_hide_password_1. Please check that your Nuget Package versions are compatible." appeared during builds when libraries referenced Android resources in certain ways. These items are now logged as informational messages instead of warnings.
  • GitHub 3336: In projects configured to use AAPT2, invalid Android resource elements added after an initial successful design-time build did not produce errors during subsequent incremental builds.
  • GitHub 3343: Errors similar to "error: cannot access ListenableFuture ... class file for com.google.common.util.concurrent.ListenableFuture not found" could cause the build to fail during the _CompileJava target when using certain libraries like Xamarin.Google.Guava.ListenableFuture that included an embedded .jar file and no public managed types.
  • GitHub PR 3379: Starting in Xamarin.Android 9.4.0.52, "The "FilterAssemblies" task was not given a value for the required parameter "DesignTimeBuild"." error prevented projects from building successfully when they uses certain additional MSBuild targets, such as the targets from the NuGet.Build.Packaging NuGet package.

Xamarin.Android SDK installation

  • GitHub PR 3350: "Package contains system volume install location content" error would prevent successful installation of the Xamarin.Android SDK on the macOS Catalina preview.

Known issues in Xamarin.Android 10.0.0.4

  • GitHub 3454: The fix for GitHub 3263 unintentionally preserves additional types during managed linking, resulting in APK files that are about 7 megabytes larger than expected, depending on which libraries the app uses.

OSS core

The corresponding open-source build without commercial features is xamarin-android-d16-3 build #27.

Both the commercial build and the open-source build use the Mono and libzip artifacts from the bundle*.7z archive generated by the previous open-source build: xamarin-android-d16-3 build #26.

Xamarin.Android 9.4.1.0

05 Aug 22:58
Compare
Choose a tag to compare

August 5, 2019 — Xamarin.Android 9.4.1.0 was released to the Stable updater channel of Visual Studio for Mac.

August 6, 2019 — Xamarin.Android 9.4.1.0 is now also available as part of Visual Studio 2019 version 16.2.1.

Issues fixed

Application behavior on device and emulator

  • GitHub 3263: Errors similar to "System.TypeLoadException: Could not load type 'Android.Text.ITextWatcherInvoker' from assembly 'Mono.Android" would cause app execution to abort during calls to certain C# bindings for Android methods in apps built with the manager linker enabled.

Application and library build process

  • GitHub 3343: Errors similar to "error: cannot access ListenableFuture ... class file for com.google.common.util.concurrent.ListenableFuture not found" could cause the build to fail during the _CompileJava target when using certain libraries like Xamarin.Google.Guava.ListenableFuture that included an embedded .jar file and no public managed types.

Xamarin.Android SDK installation

  • GitHub PR 3350: "Package contains system volume install location content" error would prevent successful installation of the Xamarin.Android SDK on the macOS Catalina preview.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-2 build #51.

Mono version for continuous build environments

For users installing Xamarin.Android on macOS continuous build environments, the corresponding version of the Mono Framework MDK to use is Mono Framework MDK 6.0.0.334.

Xamarin.Android 9.4.0.51

16 Jul 21:24
Compare
Choose a tag to compare

Update July 24, 2019: Xamarin.Android 9.4.0.51 was released as part of Visual Studio 2019 version 16.2 and to the Stable updater channel of Visual Studio for Mac.

See the Xamarin.Android 9.4 release notes for the full list of changes compared to Xamarin.Android 9.3.


Earlier information from the Xamarin.Android 9.4.0.51 pre-release

July 16, 2019: Xamarin.Android 9.4.0.51 was released as part of Visual Studio 2019 version 16.2 Preview 4.

Update July 17, 2019: Xamarin.Android 9.4.0.51 is now also available in the Preview updater channel of Visual Studio 2019 for Mac.

Corresponding Visual Studio 2019 Preview release notes

What's new in Xamarin.Android 9.4.0.51 compared to Xamarin.Android 9.4.0.34

AAPT2 disabled by default except in new projects

Because AAPT2 enforces stricter rules on resource files than the previous AAPT, some projects that built successfully with Xamarin.Android 9.3 could encounter build errors from AAPT2 after upgrading to one of the previous Xamarin.Android 9.4 previews. To allow a more gradual transition to AAPT2, the behavior of Xamarin.Android 9.4 has now been changed back to leave AAPT as the default for existing projects. Instead, now only the new project templates are set to use AAPT2 by default. Authors of new projects are encouraged to follow the stricter AAPT2 rules when possible. Authors of existing projects are encouraged to migrate to AAPT2 at their convenience.

To enable AAPT2 for a particular project, enable the Use incremental packaging system (aapt2) setting in the Visual Studio project property pages, or set the $(AndroidUseAapt2) MSBuild property to true by hand in your .csproj file:

<PropertyGroup>
    <AndroidUseAapt2>true</AndroidUseAapt2>
</PropertyGroup>

Issues fixed in Xamarin.Android 9.4.0.51

Application Mono Framework behavior on device and emulator and AOT compilation

This version of Xamarin.Android updates the Mono 6.0 runtime and class libraries from Commit c6edaa62 to Commit e6f5369c, adding 25 new commits.

Changes relevant to Xamarin.Android:

  • GitHub 3168: Xamarin.Android projects configured to use the new $(AndroidEnableProfiledAot) option would fail to build on Windows with "Assertion at ... /mono/mini/aot-compiler.c:11933, condition `res == 1' not met".
  • Mono GitHub 9664: DateTime values were switching out of daylight savings time at incorrect hours for certain time zones.
  • Mono GitHub 12577: Setting HttpClient.Timeout to a value greater than the default 100 seconds would not increase the timeout beyond 100 seconds.
  • Mono GitHub 14809: Starting in Xamarin.Android 9.4.0.17, apps using ref structs in combination with AppDomains would trigger a "System.BadImageFormatException : Cannot box IsByRefLike type 'System.ReadOnlySpan`1'" error.
  • Mono GitHub 14871: Starting in Xamarin.Android 9.4.0.17, apps that used the new Unsafe.Unbox() method either directly or indirectly via library like System.Text.Json could hit "System.MissingMethodException: Method not found: !!0& System.Runtime.CompilerServices.Unsafe.Unbox<!0>(object)".

Application behavior on device and emulator

  • GitHub 3123: Apps built with Use incremental packaging system (aapt2) enabled could hit an error similar to "Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class InflatedLibrary.CodeBehindClass occurred" after an incremental build where a custom view defined in a library project had been updated.
  • GitHub 3250: Starting in Xamarin.Android 9.4.0.17, apps that used C# keywords as Android resource names would encounter errors similar to "Android.Content.Res.Resources+NotFoundException: String resource ID #0x7f0a0028" when trying to access the resources via C#.

Application and library build process

  • Developer Community 396678: Bindings library projects could fail to build because they failed to generate corresponding C# constructors for certain Java constructors.
  • GitHub PR 3196: In certain build scenarios for projects that used AAR files, some of the Xamarin.Android MSBuild targets including _ConvertLibraryResourcesCases, _UpdateAndroidResgen, and _CreateBaseApk would always run.
  • GitHub PR 3217: Starting in Xamarin.Android 9.4.0.17, projects that used , or %3b as delimiters between values in the $(AndroidSupportedAbis) MSBuild property would fail to build. Those delimiters now work as expected again.
  • GitHub 3250: Starting in Xamarin.Android 9.4.0.17, Xamarin.Android projects using Xamarin.Forms showed a new "warning XA0106: Skipping MobileAppMasterDetail.Droid.Resource.Id.fixed" message during builds.
  • GitHub 3273: Starting in Xamarin.Android 9.4.0.17, the build time improvement from GitHub PR 2348 that allowed the ConvertResourcesCases build task to skip "well-known" assemblies was unintentionally disabled. It is now re-enabled.
  • GitHub xamarin-android-tools PR 72: In some environments, antivirus software could block access to the registry, preventing the Xamarin.Android build process from locating the default JDK installation as expected.

Xamarin.Android SDK installation

  • GitHub 3197: Starting in Xamarin.Android 9.4.0.17, the XML documentation files for the Mono and Xamarin.Android class libraries were missing from the Xamarin.Android SDK installer packages, so IntelliSense tooltips for types from those libraries did not include the expected documentation comments.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-2 build #47.

Xamarin.Android 9.5.0.27

25 Jul 05:02
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.5.0.27 was released as part of Visual Studio 2019 version 16.3 Preview 1 and to the Preview updater channel of Visual Studio 2019 for Mac.

Corresponding Visual Studio 2019 Preview release notes

What's new

Build and deployment performance

  • GitHub PR 3068: Change the two build tasks that were using %(HintPath) to use ItemSpec instead. With the way MSBuild currently works, %(HintPath) can sometimes contain incorrect leftover metadata from unrelated items, whereas ItemSpec is always correct. Also change some LINQ expressions to loops. This reduced the time for GenerateResourceDesigner from about 200 milliseconds to about 150 milliseconds in a clean build of a test project.

Preview bindings for Android Q Beta 3

GitHub PR 3208: Xamarin.Android 9.5 updates the preview bindings for Android Q Beta to match the Android Q Beta 3 release from Google. See the Android Q Beta documentation for additional information about the behavior and API changes in this new Android version. To try the bindings for the new APIs in a Xamarin.Android project, set Compile using Android version: (Target Framework) to Android 9.0.99 (Q) under the Application tab of the Visual Studio project property pages.

AAPT2 enabled by default for all projects

The previous release enabled AAPT2 by default for new projects. This Xamarin.Android 9.5 preview now enables AAPT2 by default for existing projects as well. Note that 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.

To switch back from AAPT2 to AAPT for a particular project, check and then re-uncheck the Use incremental packaging system (aapt2) setting in the Visual Studio project property pages, or set the $(AndroidUseAapt2) MSBuild property to false by hand in your .csproj file:

<PropertyGroup>
    <AndroidUseAapt2>false</AndroidUseAapt2>
</PropertyGroup>

Known issues

  • GitHub 3083: Projects that have both Use incremental packaging system (aapt2) and Generate one package (.apk) per selected ABI enabled and that have Compile using Android version: (Target Framework) set to Android 7.1 or lower will fail to build due to "The "BuildApk" task failed unexpectedly... Could not find file 'obj\Release\71\android\bin\packaged_resources-armeabi-v7a".

  • GitHub 3314: "Java.Lang.Exception: android.content.res.Resources$NotFoundException: File res/drawable/abc_vector_test.xml from drawable resource ID #0x7f080058" will abort app execution on Android 4.4 KitKat (API level 19) or lower for apps built with AAPT2 that use Android Support Libraries.

    Workaround:

    Add the --no-version-vectors option to the $(AndroidAapt2LinkExtraArgs) MSBuild property in your .csproj file:

    <PropertyGroup>
        <AndroidAapt2LinkExtraArgs>--no-version-vectors</AndroidAapt2LinkExtraArgs>
    </PropertyGroup>

    Then clean and rebuild the project.

  • GitHub 3237: Errors similar to "error CS0117: 'Resource' does not contain a definition for 'Layout'" can sometimes abort the build when attempting to build solutions with parallel builds enabled. Parallel builds are enabled by default in Visual Studio. The setting can be found in Tools > Options > Build and Run > maximum number of parallel project builds.

  • GitHub 3336: In projects configured to use AAPT2, invalid Android resource elements added after an initial successful design-time build do not produce errors during subsequent incremental builds.

  • GitHub 3344: In app projects configured to use AAPT2, builds show incorrect file paths for AAPT2 errors caused by existing library projects built with AAPT that have Android resource elements that are now invalid with AAPT2.

R8 version update to 1.4.93

GitHub PR 3121: The version of the R8 code shrinker included in Xamarin.Android has been updated from 1.3.52 to 1.4.93.

Important change

Existing Xamarin.Android projects that have the Code shrinker set to r8 and that have the Minimum Android version set to at least Android 5.0 Lollipop (API level 21) will now ignore any custom class lists provided via the MultiDexMainDexList build action. The build will output a new warning in this case:

warning XA4306: R8 does not support `MultiDexMainDexList` files when android:minSdkVersion >= 21

This change was introduced to improve compatibility with R8 version 1.4.93, which now only allows customizing the list of classes in the primary DEX file for apps with minimum Android versions lower than API level 21. For apps with higher minimum Android versions, R8 determines the list of classes automatically.

Known issues

  • GitHub 3370: In the current preview version, "warning XA4306: R8 does not support `MultiDexMainDexList` files" is shown for builds of any project that is configured to use Enable Multi-Dex, even if no @(MultiDexMainDexList) items are set. This will be corrected in a future update.

Issues fixed

Application and library build process

  • GitHub PR 2967: The "error XA0115: invalid value 'armeabi'" error message did not suggest how to remove the invalid value in cases where the value did not appear in the Visual Studio property pages.
  • GitHub PR 3115: One of the steps in the BuildApk build task did not yet log a diagnostic MSBuild message to record the outcome of the step.
  • GitHub Java.Interop PR 425: JniFieldInfo.ToString() and JniMethodInfo.ToString() threw NotSupportedException. These methods now return strings as expected.
  • "warning XA5300: Unable to determing Xamarin.Android version" could appear during one build and then disappear on the next build because the `ResolveXamarinAndroidTools` build task was not always running before the `GetPrimaryCpuAbi` task.
  • Some of the steps in the `DetectIfAppWasUninstalled` and `GetPrimaryCpuAbi` build tasks did not yet log diagnostic MSBuild messages to record their outcomes.

Application behavior on device and emulator

  • GitHub 3058: Starting in Xamarin.Android 9.2, HttpClient no longer respected the system-wide proxy settings when configured to use the default AndroidClientHandler. It would only use a proxy if the app explicitly configured one on the HttpClient instance.

Known issues in Xamarin.Android 9.5.0.27

  • GitHub 3263: Errors similar to "System.TypeLoadException: Could not load type 'Android.Text.ITextWatcherInvoker' from assembly 'Mono.Android" cause app execution to abort during calls to certain C# bindings for Android methods in apps built with the manager linker enabled.

    Workaround:

    Use a [custom linker configuration][linker-configuration] to preserve the missing types. To do that, add a new linker.xml file to the project, set the Build Action to LinkDescription, and add the XML lines to preserve the missing types. For example, for the ITextWatcherInvoker error, add the following lines to the file:

    <linker>
      <assembly fullname="Mono.Android">
        <type fullname="Android.Text.ITextWatcherInvoker" preserve="all" />
      </assembly>
    </linker>
  • GitHub 3322: Errors similar to "error MSB4018: The "LinkAssemblies" task failed unexpectedly. ... System.IO.FileNotFoundException: Could not load assembly" prevent successful completion of the build when attempting to use the old Run Code Analysis static style of code analysis that ru...

Read more

Xamarin.Android 9.3.0.23

21 Jun 20:18
Compare
Choose a tag to compare

Xamarin.Android 9.3.0.23 was released to the Stable updater channel of Visual Studio for Mac.

Update June 25, 2019: Xamarin.Android 9.3.0.23 is now also available as part of Visual Studio 2019 version 16.1.4.

Issues fixed

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 5.18 runtime and class libraries from Commit 3cb36842 to Commit 3a07bd42, adding 9 new commits.

Changes relevant to Xamarin.Android:

  • GitHub 3112, Mono GitHub 14170: "Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)" native fault during C# exception handling in 64-bit arm64-v8a applications.
  • Mono GitHub PR 14346: "error XA2006: Could not resolve reference to 'System.Buffers.StandardFormat' (defined in assembly 'Microsoft.Extensions.Configuration.Json ..." when attempting to build Xamarin.Android projects in the Release configuration, for projects that used certain NuGet packages, such as the Microsoft.Extensions.Http.Polly version 3.0.0 preview. Xamarin.Android 9.3.0.23 now includes this type, so the Android Options > Linking setting that is used by default in the Release configuration will now be able to resolve the reference successfully during the build.
  • Mono GitHub PR 14392: In certain debugging scenarios, the debugger could get stuck due when trying to suspend the running process.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-1 build #29.

Xamarin.Android 9.4.0.34

13 Jun 20:25
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.4.0.34 was released to the Preview updater channel of Visual Studio 2019 for Mac.

Update June 25, 2019: Xamarin.Android 9.4.0.34 is now also available as part of Visual Studio 2019 version 16.2 Preview 3.

Corresponding Visual Studio 2019 Preview release notes

What's new

Issues fixed in Xamarin.Android 9.4.0.34

Application Mono Framework behavior on device and emulator and AOT compilation

This version of Xamarin.Android updates the Mono 6.0 runtime and class libraries from Commit 3dc72cfe to Commit c6edaa62, adding 30 new commits.

Changes relevant to Xamarin.Android:

  • GitHub 3120: Projects with AOT Compilation enabled would fail to build with "error XA3001: Could not AOT the assembly".
  • Mono GitHub 13231: Starting in Xamarin.Android 9.4.0.17, some usage scenarios could potentially lead to a native fault due to a race condition related to marshaling a delegate to pass to unmanaged code while finalizing another delegate.
  • Mono GitHub 14214: Starting in Xamarin.Android 9.4.0.17, HttpClient.SendAsync() could fail when attempting requests with response bodies larger than 2 gigabytes due to "Cannot write more bytes to the buffer than the configured maximum buffer size."

Application and library build process

  • GitHub PR 3128, GitHub PR 3172: Building a project with Xamarin.Android 9.3 and then building the same project with Xamarin.Android 9.4 without cleaning the project between the builds would fail with "error: duplicate class: mono.MonoPackageManager_Resources ... public class MonoPackageManager_Resources {".
  • GitHub PR 3146: Attempting to submit an Android App Bundle generated by setting $(AndroidPackageFormat) to aab would result in a "The Android App Bundle was not signed." error on Google Play because the build process did not yet automatically sign the bundle with an algorithm that Google Play would accept.
  • GitHub PR 3138: Starting in Xamarin.Android 9.4.0.17, the incremental debug build times with Use Shared Runtime increased because the GenerateJavaStubs task was was performing additional work to generate the new style of unmanaged type mappings for the pre-built shared runtime APK. Xamarin.Android 9.4.0.34 no longer does that extra build work. Instead, the deployed applications now load the pre-built type mappings for the shared runtime APK from that APK, as they did in Xamarin.Android 9.3 and earlier.
  • GitHub PR 3174: Builds could fail due to "error APT0000: failed parsing overlays." for projects with Use incremental packaging system (aapt2) enabled. Xamarin.Android 9.4.0.34 updates the included aapt2 executable to version 3.4.1-5326820 to resolve this issue.
  • Builds could occasionally fail during the ResolveXamarinAndroidTools task with "Did not find Xamarin.Android at path ... warning XA5300: Unable to determine Xamarin.Android version" due to the order in which MSBuild ran the ResolveXamarinAndroidTools task relative to the DetectIfAppWasUninstalled task.
  • @(AndroidAsset) MSBuild items that used %(LogicalName) metadata with relative paths were not copied to the correct intermediate output location during the build.

Application behavior on device and emulator

  • GitHub 3169: Applications could hit an exception similar to "Failed resolution of: Landroid/support/v7/appcompat/R$drawable; ---> Java.Lang.ClassNotFoundException: Didn't find class "android.support.v7.appcompat.R$drawable" on path: DexPathList" in projects that had Use incremental packaging system (aapt2) enabled.

Known issues in Xamarin.Android 9.4.0.34

  • GitHub 3168: The new $(AndroidEnableProfiledAot) option to enable compiling a specific subset of methods to unmanaged code is not yet ready to try on Windows in this version. The unmanaged compilation step fails on Windows with "Assertion at ... /mono/mini/aot-compiler.c:11933, condition `res == 1' not met".

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-2 build #32.

Xamarin.Android 9.4.0.17

11 Jun 21:34
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.4.0.17 was released as part of Visual Studio 2019 version 16.2 Preview 2.

Corresponding Visual Studio 2019 Preview release notes

What's new

Build and deployment performance

  • GitHub PR 2536, with follow-up adjustments in GitHub PR 2870, GitHub PR 2878, GitHub PR 2916: Add a .jar file to the Xamarin.Android installer package that contains pre-built versions of a number of Java classes that are used by every Xamarin.Android project. That way the individual projects don't need to build the Java classes themselves. This reduced the total time for the Java compilation step on a clean build of a test app from about 2.7 seconds to about 2.5 seconds.
  • GitHub PR 2896: Adjust the Android resource compilation build step to avoid re-running AAPT (or AAPT2) individually for each library and to avoid generating many extra unused resource IDs. In apps that reference libraries containing many resources, such as the Xamarin.Android.Support and Xamarin.GooglePlayServices libraries, this will often dramatically decrease the total number of fields in the app. This means that those apps are now less likely to exceed the DEX 64K reference limit and less likely to require the Enable Multi-Dex setting in the Visual Studio project property pages. For example, in a test Xamarin.Forms application, the number of references in the .dex file dropped from about 30,000 to about 18,000, the .dex file size decreased from about 3.5 megabytes to about 3.4 megabytes, and the total time for the resource compilation step in a clean build dropped from approximately 3 seconds to about 20 milliseconds.
  • GitHub PR 2930: Revise the Inputs and Outputs for the _BuildLibraryImportsCache target, and adjust the GetImportedLibraries to take advantage of those adjustments. This allows incremental builds to skip the _BuildLibraryImportsCache target when appropriate. It also improves the performance of GetImportedLibraries for clean builds. For example, in a test Xamarin.Forms app, this change saved approximately 100 milliseconds for an incremental build after a XAML file change, and it reduced the clean build time for the GetImportedLibraries target from approximately 300 milliseconds to approximately 170 milliseconds in the same project.
  • GitHub PR 2934, with follow-up adjustments in GitHub PR 2958: Avoid running the Xamarin.Android-specific _BuildAdditionalResourcesCache or _ResolveLibraryProjectImports build steps on assembly types like .NET Standard assemblies that never contain Xamarin.Android library project features such as Android resources. This reduced the incremental build time for these steps from about 360 milliseconds to about 80 milliseconds in a test Xamarin.Forms app where only the .NET Standard project was modified between builds. This also reduced the clean build time for these steps in the same project from about 1.8 seconds to about 1.2 seconds.
  • GitHub PR 2935: Avoid copying extra .pdb or .mdb debugging symbol files to the bin output directory in cases where the corresponding .dll assembly files themselves are not copied to the output directory. Depending on the size and number of debugging symbols for a project and the speed of the drive where the output directory is stored, this change can potentially save a noticeable amount of time. In a smaller test project built on an SSD, this change saved roughly a few dozen milliseconds for an incremental build where an assembly changed.
  • GitHub PR 2952: Remove old debug logging messages from several of the build tasks. Since MSBuild prints this information automatically when building with diagnostic verbosity, these additional logging messages are no longer needed. In some cases this change can also reduce the total build time. For example, in a test app, it reduced the clean build time from roughly 25.5 seconds to about 25.0 seconds.
  • GitHub PR 2956: Expand on the previous improvement from GitHub PR 2643 that allowed the GenerateJavaStubs task to skip over .NET Standard assemblies by now also skipping the whole parent _GenerateJavaStubs target in cases where only .NET Standard assemblies have changed. This allowed a small test Xamarin.Forms project to skip the _GenerateJavaStubs target successfully, saving approximately 860 milliseconds for an incremental build in the case where only a XAML file was changed.

Mono Framework version update to 6.0

This version of Xamarin.Android updates the Mono runtime and class libraries from Mono 5.18 to Mono 6.0 Commit 3dc72cfe, adding about 1,800 new commits.

Support for Android App Bundle publishing format

GitHub PR 2841, with follow-up adjustments in GitHub PR 2989: At Google I/O 2018, Android introduced a new Android App Bundle publishing format for Google Play. Xamarin.Android 9.4 includes a new build option to generate Android App Bundles for Xamarin.Android apps. To try this new output format with your project, set the $(AndroidPackageFormat) MSBuild property to aab in your .csproj file:

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <AndroidPackageFormat>aab</AndroidPackageFormat>
</PropertyGroup>

When this property is set, the SignAndroidPackage MSBuild target will create an archive in the bin directory that follows the Android App Bundle format. But be aware that there is a known issue with the current preview where the build process does not yet automatically sign the bundle with an algorithm that Google Play will accept.

Known issues

  • GitHub PR 3146: Attempting to submit an Android App Bundle generated with $(AndroidPackageFormat) set to aab will currently result in a "The Android App Bundle was not signed." error on Google Play. A manual workaround is to re-sign the .aab archive by hand using jarsigner.exe in a command prompt, using a command similar to:

    "C:\Program Files\Android\jdk\microsoft_dist_openjdk_1.8.0.25\bin\jarsigner.exe" ^
        -digestalg SHA-256 ^
        -sigalg SHA256withRSA ^
        -keystore "C:\Users\WindowsUser\com.contoso.keystore" ^
        -storepass password ^
        -keypass password ^
        -signedjar bin\Release\com.contoso.app1-Signed.aab ^
        obj\Release\90\android\bin\com.contoso.app1.aab ^
        com.contoso

    The last 5 lines of this example command would all need to be adjusted to match your particular keystore information and application name.

  • Setting $(AndroidPackageFormat) to aab currently increases build times for the Use Fast Deployment Debug configuration setting, so it is recommended to set the new property only for the Release configuration for now.

App startup performance

  • GitHub PR 2718, with follow-up adjustments in GitHub PR 3010, GitHub PR 3026: Generate unmanaged native shared libraries to provide the per-application Java-to-managed and managed-to-Java type mappings and environment settings that Xamarin.Android applications use. Previously, this information was stored in data files within the APK that the applications would load and parse during startup, but now the application can directly run the unmanaged executable instructions instead. This reduced the startup time from about 240 milliseconds to about 230 milliseconds for a Release con...
Read more

Xamarin.Android 9.3.0.22

21 May 19:14
Compare
Choose a tag to compare

Xamarin.Android 9.3.0.22 was released as part of Visual Studio 2019 version 16.1.

Update June 4, 2019: Xamarin.Android 9.3.0.22 is now also available in the Preview updater channel of Visual Studio 2019 for Mac.

Update June 13, 2019: Xamarin.Android 9.3.0.22 is now available in the Stable updater channel of Visual Studio 2019 for Mac.

Issues fixed

Application and library build process

  • Developer Community 551186, GitHub 3045: Starting in Visual Studio 2019 version 16.1 Preview 2, projects referencing certain NuGet packages such as Microsoft.Extensions.Http would fail to build with an error similar to "FileNotFoundException: Could not load assembly 'System.Runtime..." during the LinkAssemblies task.

Application behavior on device and emulator

  • GitHub PR 3009: Apps built with multidex and either the ProGuard or R8 code shrinker enabled could fail during startup with "java.lang.ClassNotFoundException: Didn't find class "android.support.multidex.MultiDexApplication"" unless a rule was explicitly added to the ProGuard configuration file to preserve the class. Xamarin.Android 9.3 now includes an appropriate ProGuard configuration rule by default, so the rule no longer needs to be added by hand.

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 5.18 runtime and class libraries from Commit 3f5ec6d9 to Commit 3cb36842, adding 5 new commits.

In this particular case, none of the new commits are expected to be relevant to Xamarin.Android projects. The changes are included to keep the Mono commit aligned with the desktop Mono Framework MDK and Xamarin.iOS.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-1 build #28.

Xamarin.Android 9.3.0.19

08 May 00:47
Compare
Choose a tag to compare
Pre-release

Xamarin.Android 9.3.0.19 was released as part of Visual Studio 2019 version 16.1 Preview 3 and to the Preview updater channel of Visual Studio 2019 for Mac.

Issues fixed

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 5.18 runtime and class libraries from Commit bf4e8d2a to Commit 3f5ec6d9, adding 1 new commit:

  • Mono GitHub 13878: For Xamarin.Mac, certain JIT features were not yet compatible with new macOS security features. This commit is not important for Xamarin.Android itself. It is included in this release to keep the Mono commit aligned with Xamarin.Mac and Xamarin.iOS.

Design-time build process

  • GitHub PR 2991: Starting in Visual Studio 2019 version 16.1 Preview 2, design-time features such as IntelliSense could fail in certain cases if a referenced library included an empty Android resources directory.

Xamarin.Android SDK installation

  • GitHub PR 2959: Starting in Visual Studio 2019 version 16.1 Preview 2, Xamarin.Android included a number of unneeded temporary files left over from the installer package build process. The installer package for Xamarin.Android 9.3.0.19 no longer includes those unneeded files.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-1 build #25.

Xamarin.Android 9.2.3.0

18 Apr 18:56
Compare
Choose a tag to compare

Xamarin.Android 9.2.3.0 was released to the Stable updater channel of Visual Studio 2019 for Mac.

Update April 30, 2019: Xamarin.Android 9.2.3.0 is now also available as part of Visual Studio 2019 version 16.0.3. The difference in publication date was due to a few coincidences with the timing of this particular release.

Issues fixed

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 5.18 runtime and class libraries from Commit 5ad371da to Commit 5ac37ccd, adding 2 new commits:

  • Developer Community 435502, Developer Community 515603, GitHub 2920: Xamarin.Android apps would crash during debugging when they called certain APIs. Applications affected by this issue would run successfully if launched without the debugger attached, but when launched with the debugger attached, the applications would exit unexpectedly after one of the problematic APIs was called. The debug output would show a "Fatal signal 11 (SIGSEGV)" after the crash.
  • Mono GitHub 13610: Xamarin.Android projects in which users had explicitly set a value for the undocumented, experimental $(AndroidAotMode) MSBuild property could hit a problem where methods that returned Task objects or generic types would lead to incorrect return values. This is not expected to be an issue for any current Xamarin.Android projects. The fix is included in this release to keep the Mono commit aligned with Xamarin.iOS.

OSS core

The commercial build for this version is based on the bundle from the open-source xamarin-android-d16-0 build #36.