Skip to content

Releases: dotnet/android

Xamarin.Android 10.1.3.7

14 Jan 23:58

Choose a tag to compare

January 14, 2020 — Xamarin.Android 10.1.3.7 was released as part of Visual Studio 2019 version 16.4.3 and to the Stable updater channel of Visual Studio 2019 for Mac version 8.4.1.

Corresponding Visual Studio 2019 release notes

Issues fixed in Xamarin.Android 10.1.3.7

Application and library build and deployment

  • Developer Community 845978, GitHub 3993: Starting in Xamarin.Android 10.1, You uploaded an APK or Android App Bundle with invalid or missing signing information for some of its files prevented uploading successfully to Google Play for apps built using the Android App Bundle publishing format.

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.6 runtime and class libraries from Commit bef1e633 to Commit fd9f379d, adding 3 new commits.

Fixes included for issues reported with Xamarin.Android applications:

  • Developer Community 756697: Starting in Xamarin.Android 10.0, NTLM authentication in Xamarin.Android apps no longer worked, resulting in server-side System.ComponentModel.Win32Exception exceptions.

Installing

To get the new version in Visual Studio, update Visual Studio:

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

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.6.0.155.

Open source

Xamarin.Android 10.1.1.0

10 Dec 22:44

Choose a tag to compare

January 8, 2020 — Xamarin.Android 10.1.1.0 was released to the Stable updater channel of Visual Studio 2019 for Mac version 8.4.

December 10, 2019 — Xamarin.Android 10.1.1.0 was released as part of Visual Studio 2019 version 16.4.1.

Mono Framework version update

This version of Xamarin.Android updates the Mono 6.6 runtime and class libraries from Commit e1ef7743 to Commit bef1e633, adding 9 new commits.

This update does not contain any changes that affect Xamarin.Android. The update just keeps the Mono commit aligned with Xamarin.iOS, Xamarin.Mac, and Visual Studio for Mac.

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.6.0.155.

Xamarin.Android 10.2.0.16

03 Dec 21:28

Choose a tag to compare

Pre-release

December 3, 2019 — Xamarin.Android 10.2.0.16 was released as part of Visual Studio 2019 version 16.5 Preview 1.

Important: The names for generated Java types are different in this release. Any project that explicitly uses one of the old names that starts with md5 will need to be updated by hand to account for this change. See Breaking change for generated Java type names below for more details.

Corresponding Visual Studio 2019 Preview release notes

What's new

Breaking change for generated Java type names

The fallback option in Xamarin.Android 10.1 that allowed using the old style of generated Java type names that started with md5 has now been removed.

Authors of projects that include literal uses of generated Java type names that start with md5 will now need to transition to alternatives like the [Register] attribute and the [Activity] attribute.

Projects that have the LowercaseMD5 fallback option set in the $(AndroidPackageNamingPolicy) MSBuild property will now fail to build with the following error:

error XAGJS7015: System.NotSupportedException: PackageNamingPolicy.LowercaseHash is no longer supported.

To resolve the error, remove the section for the $(AndroidPackageNamingPolicy) property from your .csproj file:

<PropertyGroup>
  <AndroidPackageNamingPolicy>LowercaseMD5</AndroidPackageNamingPolicy>
</PropertyGroup>

See the Xamarin.Android 10.1 release notes for additional background information about this change and examples of how to update existing projects.

Build and deployment performance

  • GitHub PR 3692: For the specific scenario of Debug builds that have Use Fast Deployment enabled, undo part of the change from GitHub PR 2718 so that type mappings are parsed at run time instead of being compiled into unmanaged native shared libraries. This reduced the time for the GenerateJavaStubs task from about 540 milliseconds to about 320 milliseconds for an incremental build of a test app where the MainActivity type was modified between builds. As expected, this did increase the app startup time from about 1.30 seconds to about 1.35 seconds, but that still left an overall savings of approximately 170 milliseconds.
  • GitHub PR 3856: Add a fallback naming scheme for the files that mark whether the outputs of the _CompileAndroidLibraryResources target are up-to-date with the input files. This allows projects that use a google-services.json item and that are configured to use AAPT2 to skip the _CompileAndroidLibraryResources target correctly during incremental builds.
  • GitHub PR 3889: Update the _GeneratePackageManagerJavaForDesigner target to check the timestamp of the MonoPackageManager_Resources.java output file instead of the old obsolete MonoPackageManager.java file that was used in Xamarin.Android 9.3 and earlier. This reduced the total time for the SetupDependenciesForDesigner target by about 500 milliseconds for a small app on a test system. The SetupDependenciesForDesigner targets runs in the background for interactive scenarios in Visual Studio after an Android resource has changed.
  • GitHub PR 3891: Avoid unnecessary changes to the build.props intermediate file during design-time builds so that the UpdateGeneratedFiles and SetupDependenciesForDesigner targets can skip the _ResolveLibraryProjectImports target. This reduced the time for the UpdateGeneratedFiles target by about 300 milliseconds for a small app on a test system. The UpdateGeneratedFiles target runs in the foreground each time an Android resource is saved, so this makes Visual Studio more responsive when working on Android resources.

App startup performance

  • GitHub PR 3729: Initialize application logging and uncaught exception handling lazily. This reduced the time to display the first screen of a small test Xamarin.Forms app from about 783 milliseconds to about 754 milliseconds for a Release configuration build on a Google Pixel 3 XL device.
  • GitHub PR 3780: Simplify how Android system properties are looked up for internal uses within the Xamarin.Android runtime. This cut off about 1 millisecond from the total app startup time.

D8 enabled by default for all projects

Xamarin.Android has included an option to use the D8 DEX compiler since Xamarin.Android 9.2, but is has so far been disabled by default to provide a gradual path for finding and addressing compatibility issues. Starting in Xamarin.Android 10.2, the D8 DEX compiler option is now enabled by default for both existing and new projects.

To switch back from D8 to the earlier DX compiler for a particular project, set the Dex compiler option in the Visual Studio project property pages to dx, or set the $(AndroidDexTool) MSBuild property to dx by hand in your .csproj file:

<PropertyGroup>
  <AndroidDexTool>dx</AndroidDexTool>
</PropertyGroup>

Android App Bundle publishing format workflow improvements

Xamarin.Android 10.2 adds two improvements to the support for Android App Bundle publishing format to align it more closely with the support for the APK publishing format.

The first change is that the Xamarin.Android MSBuild targets now copy the unsigned .aab file to the output directory. Previously, only the signed .aab file was copied to the output directory. The unsigned file can be useful in continuous integration environments where you might want to build just the PackageForAndroid MSBuild target to generate an unsigned .aab file that you can sign in a separate step.

This change resolve the following issue:

  • GitHub 3804: Building the PackageForAndroid target, for example by running msbuild -restore -p:Configuration=Release -t:PackageForAndroid, does not output an unsigned .aab file to the output path in projects configured to use the Android App Bundle publishing format.

The second change is that the directory name for the mono-symbolicate .pdb symbol file archive now ends with the expected .aab.mSYM extension instead of .apk.mSYM.

Mono Framework version update

This version of Xamarin.Android updates the Mono 6.6 runtime and class libraries from Commit e1ef7743 to Commit 062f0ab8, adding 1 new commit.

This update does not contain any changes that affect Xamarin.Android. The update just keeps the Mono commit aligned with Xamarin.iOS, Xamarin.Mac, and Visual Studio for Mac.

XA2001 error for nonexistent Android resources

Xamarin.Android 10.2 adds a new XA2001 build error to identify cases where projects might unintentionally include references to Android resource file paths that do not exist. Example:

error XA2001: Source file 'Resources\layout\missing.xml' could not be found.

Before this change, projects that included references to nonexistent Android resources would rebuild the _CompileResources and _UpdateAndroidResgen targets on every build. The new error protects against this by ensuring that project authors remove references to nonexistent resources.

AAPT2 version update to 3.5.0-5435860

The version of the...

Read more

Xamarin.Android 10.1.0.30

11 Nov 20:54
5e2fd06

Choose a tag to compare

Update January 8, 2020: Xamarin.Android 10.1.1.0 was released to the Stable updater channel of Visual Studio 2019 for Mac version 8.4.

Update December 3, 2019: Xamarin.Android 10.1.0.30 was released as part of Visual Studio 2019 version 16.4.

See the Xamarin.Android 10.1 release notes for the full list of changes compared to Xamarin.Android 10.0.


Earlier information from the Xamarin.Android 10.0.3.0 pre-release

November 14, 2019 — Xamarin.Android 10.0.3.0 was released as part of Visual Studio 2019 version 16.4 Preview 5.

November 11, 2019 — Xamarin.Android 10.1.0.30 was released to the Preview updater channel of Visual Studio 2019 for Mac version 8.4 Preview 2.1.

Corresponding Visual Studio 2019 Preview release notes

What's new

Issues fixed in Xamarin.Android 10.1.0.30

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.6 runtime and class libraries from Commit 8946e49a to Commit e1ef7743, adding 8 new commits.

Fixes included for issues reported with Xamarin.Android applications:

  • Developer Community 668413, GitHub 3426, Mono GitHub 17133: Starting in Xamarin.Android 9.4, System.UnauthorizedAccessException: Access to the path is denied. ---> System.IO.IOException: Operation not permitted prevented using File.Copy() to copy files to the Android external storage directory.

Open source

The corresponding open-source build without commercial features is xamarin-android-d16-4 build #42.

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.6.0.155.

Xamarin.Android 10.0.6.2

05 Nov 21:17
c407838

Choose a tag to compare

November 5, 2019 — Xamarin.Android 10.0.6.2 was released as part of Visual Studio 2019 version 16.3.8 and to the Stable updater channel of Visual Studio for Mac version 8.3.7.

Issues fixed in Xamarin.Android 10.0.6.2

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.4 runtime and class libraries from Commit 5608fe0a to Commit 476d72b9, adding 7 new commits.

The primary reason for this update is to keep the Mono commit aligned with Xamarin.iOS and Visual Studio for Mac, but it also provides a fix for one issue that was reported in Xamarin.Android applications:

  • GitHub 3726: System.NotSupportedException: TypeConverter cannot convert from System.String. prevented apps from using TypeConverter.ConvertFromString() to create an instance of System.Drawing.Color.

OSS core

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

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.4.0.208.

Xamarin.Android 10.1.0.29

04 Nov 18:32
bbb5297

Choose a tag to compare

Pre-release

November 4, 2019 — Xamarin.Android 10.1.0.29 was released as part of Visual Studio 2019 version 16.4 Preview 3 and to the Preview updater channel of Visual Studio 2019 for Mac version 8.4 Preview 2.

Corresponding Visual Studio 2019 Preview release notes

What's new

Issues fixed in Xamarin.Android 10.1.0.29

Application and library build process

  • GitHub 3571: Errors returned by the ProGuard tool were all surfaced under an unspecific and misleading error MSB6006: "java.exe" exited with code 1. build error. Xamarin.Android 10.1 now includes the more specific error text from ProGuard in the build error.
  • GitHub PR 3685: warning ANDJS0000 was always shown for the jarsigner warnings The signer's certificate is self-signed. and No -tsa or -tsacert is provided and this jar is not timestamped. Those messages were not relevant for Xamarin.Android users, so Xamarin.Android 10.1 now reports them as informational messages rather than warnings.
  • GitHub PR 3750: Starting in Xamarin.Android 10.1.0.1, ObjectDisposedException ... at HashAlgorithm.ComputeHash could projects from building successfully if they referenced Xamarin.Android.Support libraries version 26 or earlier.
  • GitHub PR 3766: The new exception code prefixes added in GitHub PR 3609 did not yet include specific error codes for unexpected element <activity> found in <manifest> and other similar errors caused by elements located in unexpected locations in the AndroidManifest.xml file.
  • GitHub 3779: In projects configured to use AAPT2, the second build could incorrectly succeed without errors if the first build failed due to an error in an Android resource file.
  • GitHub 3807: Xamarin.Android projects did not yet enable C# 8 features by default for projects that left the $(MaxSupportedLangVersion) MSBuild property at the default empty value.
  • Java.Interop GitHub 496: Bindings projects for Kotlin libraries could fail to build due to hyphen characters in method names generated by Kotlin.

Application deployment

Application behavior on device and emulator

  • Developer Community 749635: Starting in Xamarin.Android 10.0.99.100, apps could exit during launch on certain older Android devices, resulting in the message Couldn't connect to logcat, GetProcessId returned: 0. Couldn't connect debugger. in the Debug output.
  • GitHub 3348: FATAL EXCEPTION: main ... java.lang.IllegalStateException: Module with the Main dispatcher is missing. could prevent apps from running if they referenced Kotlin libraries.
  • GitHub 3751: Methods marked with Lifecycle.Event attributes were not called as expected in apps built with the D8 Dex compiler in combination with Enable Multi-Dex.
  • GitHub 3758: Starting in Xamarin.Android 10.1.0.1, System.IO.FileNotFoundException: Could not load the file 'Mono.Android.Export' prevented apps from running successfully in the Debug configuration if they used types from the Mono.Android.Export assembly.

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.6 runtime and class libraries from Commit 52810372 to Commit 8946e49a, adding 41 new commits.

Fixes included for issues reported with Xamarin.Android applications:

  • GitHub 3726: System.NotSupportedException: 'TypeConverter cannot convert from System.String. prevented apps from using TypeConverter.ConvertFromString() to create an instance of System.Drawing.Color.

OSS core

The corresponding open-source build without commercial features is xamarin-android-d16-4 build #41.

Xamarin.Android 10.0.3.0

08 Oct 01:39

Choose a tag to compare

October 8, 2019 — Xamarin.Android 10.0.3.0 was released as part of Visual Studio 2019 version 16.3.3.

October 7, 2019 — Xamarin.Android 10.0.3.0 was released to the Stable updater channel of Visual Studio 2019 for Mac version 8.3.

Issues fixed in Xamarin.Android 10.0.3.0

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.4 runtime and class libraries from Commit 7af64d1e to Commit 5608fe0a, adding 18 new commits.

Fixes included for issues reported with Xamarin.Android applications:

  • Mono GitHub 16395: DateTime.Now transitioned to daylight saving time an hour late in certain time zones.
  • Mono GitHub 16950: Starting in Xamarin.Android 9.4, NotImplementedException for DeflateStream.WriteCore() prevented using StreamWriter with GZipStream.

Application and library build process

  • Mono GitHub 17064: Errors similar to Failed to resolve System.Void System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute::.ctor(System.Boolean) could prevent deploying or archiving successfully in the Release configuration for apps that referenced .NET Standard 2.1 libraries such as Microsoft.EntityFrameworkCore 3.0.

OSS core

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

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

Xamarin.Android 10.1.0.1

15 Oct 19:54

Choose a tag to compare

Pre-release

October 17, 2019 — Xamarin.Android 10.1.0.1 was released to the Preview updater channel of Visual Studio 2019 for Mac version 8.4 Preview 1.

October 15, 2019 — Xamarin.Android 10.1.0.1 was released as part of Visual Studio 2019 version 16.4 Preview 2.

Important: The default names for generated Java types are different in this release. Any project that explicitly uses one of the old default names that starts with md5 will need to be updated by hand to account for this change. See Breaking change for generated Java type names below for more details.

Corresponding Visual Studio 2019 Preview release notes

What's new

Breaking change for generated Java type names

Any project that explicitly uses one of the old default Java type names that starts with md5 will break in Xamarin.Android 10.1.

To restore the previous behavior temporarily, you can set the $(AndroidPackageNamingPolicy) MSBuild property to LowercaseMD5 in your .csproj file:

<PropertyGroup>
    <AndroidPackageNamingPolicy>LowercaseMD5</AndroidPackageNamingPolicy>
</PropertyGroup>

This backward compatibility option will be removed in the upcoming Xamarin.Android 10.2 version, so authors of projects that currently include literal uses of these default names are encouraged to transition to alternatives like the [Register] attribute and the [Activity] attribute as soon as possible.

Example breakage for a custom view

For a custom view like:

namespace AndroidApp1
{
    public class View1 : View
    {
        /* ... */
    }
}

One scenario that will break is if the literal Java type name md559d7fc296fc238aa7bec92ba27f2cb33.View1 is used in a layout file:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <md559d7fc296fc238aa7bec92ba27f2cb33.View1
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>

This will result in an error when the app tries to inflate the layout:

Android.Views.InflateException: Binary XML file line #1 in com.contoso.androidapp1:layout/layout1: Binary XML file line #1 in com.contoso.androidapp1:layout/layout1: Error inflating class md559d7fc296fc238aa7bec92ba27f2cb33.View1 ---> Android.Views.InflateException: Binary XML file line #1 in com.contoso.androidapp1:layout/layout1: Error inflating class md559d7fc296fc238aa7bec92ba27f2cb33.View1 ---> Java.Lang.ClassNotFoundException: md559d7fc296fc238aa7bec92ba27f2cb33.View1 ---> Java.Lang.ClassNotFoundException: Didn't find class "md559d7fc296fc238aa7bec92ba27f2cb33.View1" on path: DexPathList

The typical fix is to use the type name of C# class in the layout file instead:

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
-    <md559d7fc296fc238aa7bec92ba27f2cb33.View1
+    <AndroidApp1.View1
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
 </LinearLayout>

Another option is to use a [Register] attribute to customize the generated Java type name:

 namespace AndroidApp1
 {
+    [Register("com.contoso.androidapp1.view1")]
     public class View1 : View
     {

And then use that customized name in the layout file:

 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical"
     android:layout_width="match_parent"
     android:layout_height="match_parent">
-    <md559d7fc296fc238aa7bec92ba27f2cb33.View1
+    <com.contoso.androidapp1.view1
         android:layout_width="match_parent"
         android:layout_height="match_parent" />
 </LinearLayout>

Example breakage for an activity

For an activity like:

namespace AndroidApp1
{
    public class MainActivity : Activity
    {
        /* ... */
    }
}

One scenario that will break is if the literal Java type name md559d7fc296fc238aa7bec92ba27f2cb33.MainActivity is used in the AndroidManifest.xml file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          android:versionCode="1"
          android:versionName="1.0"
          package="com.contoso.androidapp1">
  <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
  <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
    <activity android:label="@string/app_name" android:name="md559d7fc296fc238aa7bec92ba27f2cb33.MainActivity">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest>

This will result in an error when the app tries to start the activity:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.contoso.androidapp1/md559d7fc296fc238aa7bec92ba27f2cb33.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "md559d7fc296fc238aa7bec92ba27f2cb33.MainActivity" on path: DexPathList

The typical fix is to add an [Activity] attribute on the C# class to generate the <activity> manifest element automatically:

 namespace AndroidApp1
 {
+    [Activity(Label = "@string/app_name", MainLauncher = true)]
     public class MainActivity : Activity
     {

And then remove the handwritten <activity> element from AndroidManifest.xml:

  <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
-   <activity android:label="@string/app_name" android:name="md559d7fc296fc238aa7bec92ba27f2cb33.MainActivity">
-     <intent-filter>
-       <action android:name="android.intent.action.MAIN" />
-       <category android:name="android.intent.category.LAUNCHER" />
-     </intent-filter>
-   </activity>
 </application>

Background information

This change comes from GitHub PR 3649, which switched the checksum algorithm used to create names for generated Java types from MD5 to CRC-64 to improve compatibility with build environments that have FIPS compliance enforced.

The use of MD5 checksums for these names was originally introduced in Xamarin.Android 5 to reduce the chance of conflicts among the names. See the release notes from that version and the related documentation for additional examples of how to resolve issues related to this change.

SHA-256 by default for APK signing and digest algorithms

Xamarin.Android 10.1 switches the default value of the $(AndroidApkSigningAlgorithm) MSBuild property from md5withRSA to SHA256withRSA and the default value of the $(AndroidApkDigestAlgorithm) MSBuild property from SHA1 to SHA-256. The $(AndroidApkSigningAlgorithm) property corresponds to the -sigalg option of the [jarsigner][jarsigner] command, and the $(AndroidApkDigestAlgorithm) corresponds to the -digestalg option.

This change is not expected to cause complications for existing apps, but if needed, existing projects can restore the previous behavior by setting the MSBuild properties back to the previous values in the .csproj file:

<PropertyGroup>
  <AndroidApkSigningAlgorithm>md5withRSA</AndroidApkSigningAl...
Read more

Xamarin.Android 10.0.99.100

23 Sep 19:48

Choose a tag to compare

Pre-release

Xamarin.Android 10.0.99.100 was released as part of Visual Studio 2019 version 16.4 Preview 1.

Corresponding Visual Studio 2019 Preview release notes

What's new

Build and deployment performance

  • GitHub PR 3296: Remove an unneeded LINQ Distinct() call from the ResolveLibraryProjectImports task. This saved about 25 milliseconds for each run of the task in a test environment.
  • GitHub PR 3354: Improve the behavior of the _GenerateJavaStubs task so that it is skipped as expected during an incremental build of a Xamarin.Android bindings library project when no files have changed.
  • GitHub PR 3359: Allow the managed linker to read the input assemblies from their original locations instead of copying them to an intermediate obj\Debug\*\linksrc directory beforehand. This removes the _CopyMdbFiles, _CopyPdbFiles, and _CopyIntermediateAssemblies targets. Those targets previously took approximately 150 milliseconds for a test Xamarin.Forms app when only one XAML file was changed between builds. Depending on system speed and antivirus settings, the total savings can be greater. For example, for one tested example project and environment, the overall build time decreased from about 33 seconds to about 30 seconds.
  • GitHub PR 3528: Correct the Inputs and Outputs for the SetupDependenciesForDesigner and _ResolveLibraryProjectImports targets, and add an option for the Javac task to skip creating a classes.zip file when running for the designer. In addition to improving the designer responsiveness, this also allows projects to skip the _CompileToDalvikWithDx or _CompileToDalvikWithD8 target in incremental builds when only an Android XML layout file has changed. For example, in one test of an example project, the _CompileToDalvikWithD8 target previously took roughly 4.6 seconds for this scenario, and now it is skipped completely.
  • GitHub PR 3535, GitHub PR 3600: Add and switch to a new specialized LinkAssembliesNoShrink MSBuild task for Debug builds. In the Debug scenario, where the managed linker is not set to remove any types, the managed linker only needs to run a quick step to adjust abstract methods in Xamarin.Android assemblies. The new specialized task reduced the time for the _LinkAssembliesNoShrink target from about 340 milliseconds to about 10 milliseconds for a test Xamarin.Forms app when one line of a XAML file was changed between builds.
  • GitHub PR 3555: Improve the behavior around the _BuildApkFastDev target so it is skipped correctly when a Xamarin.Android app project has changes that do not require building a new APK. For example, changes to user-defined classes do not require a new APK unless they inherit from Java.Lang.Object, but the target was running if any class in the app project changed. Correcting this behavior saved roughly 2.5 seconds for the deployment time of a small test Xamarin.Android app on a fast build machine.

Mono Framework version update to 6.6

This version of Xamarin.Android updates the Mono runtime and class libraries from Mono 6.4 to Mono 6.6 Commit 29b1ac19, adding about 700 new commits.

Binding project improvements with C# 8.0 for Java interface members

In Android 7.0 Nougat (API level 24) and higher, some Android libraries started using new Java 8 language features, including:

  • Default interface methods
  • Static interface methods
  • Interface constants

C# 8.0 introduces a similar default interface members language feature. Starting in Xamarin.Android 10.1, Xamarin.Android bindings projects can now take advantage of this new capability to surface C# APIs that more closely match the original APIs in the Java libraries.

To try this functionality with your bindings project, set the $(LangVersion) MSBuild property to preview and the $(_EnableInterfaceMembers) MSBuild property to true in your .csproj file:

<PropertyGroup>
  <LangVersion>preview</LangVersion>
  <_EnableInterfaceMembers>true</_EnableInterfaceMembers>
</PropertyGroup>

Note that enabling this new option only adds members. It does not remove the previous style of C# bindings for these kinds of Java APIs.

Environment variables and files for package signing passwords

Until now, the Keystore Password and Alias Password settings in the Android Package Signing section of the Visual Studio project property pages only supported literal password values. Starting in Xamarin.Android 10.1, these settings now support a new syntax that allows entering environment variable names or file names instead. These options provide a way to prevent the passwords from appearing in build logs.

To use an environment variable name, prefix the name with env:. To use a local file path, prefix the path with file:.

For example, to use an environment variable named AndroidSigningPassword for both settings, enter env:AndroidSigningPassword under both the Keystore Password and Alias Password settings. This sets the corresponding $(AndroidSigningStorePass) and $(AndroidSigningKeyPass) MSBuild properties in your .csproj file:

<PropertyGroup>
  <AndroidSigningStorePass>env:AndroidSigningPassword</AndroidSigningStorePass>
  <AndroidSigningKeyPass>env:AndroidSigningPassword</AndroidSigningKeyPass>
</PropertyGroup>

To use a file located at C:\Users\Windows User\AndroidSigningPassword.txt for both settings, enter file:C:\Users\Windows User\AndroidSigningPassword.txt. This again sets the corresponding $(AndroidSigningStorePass) and $(AndroidSigningKeyPass) MSBuild properties in your .csproj file:

<PropertyGroup>
  <AndroidSigningStorePass>file:C:\Users\Windows User\AndroidSigningPassword.txt</AndroidSigningStorePass>
  <AndroidSigningKeyPass>file:C:\Users\Windows User\AndroidSigningPassword.txt</AndroidSigningKeyPass>
</PropertyGroup>

Note that if the same file is specified for both settings, the file must contain two lines. The first line must be the keystore password, and the second line must be the alias password.

Mono.Data.Sqlite SQLite version update

The version of SQLite used by Mono.Data.Sqlite in Xamarin.Android has been updated from 3.27.1 to 3.28.0, bringing in several improvements and bug fixes.

Issues fixed in Xamarin.Android 10.0.99.100

Application and library build process

  • Developer Community 237753, Developer Community 554407, GitHub 3407: Errors similar to [aot-compiler stderr] Cannot open assembly 'Files': No such file or directory. or Illegal characters in path ... at Xamarin.Android.Tasks.Aot could prevent projects using Enable Startup Tracing or AOT Compilation from building successfully on volumes where Windows 8.3 file name creation was disabled. Xamarin.Android 10.1 now uses a response file to pass command line parameters to the tooling for these steps, so having 8.3 file name creation enabled is no longer required.
  • Developer Community 618007, GitHub 3294: Could not find android.jar for API Level 28. ... Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...) error message did not indicate the correct menu location for the Android SDK Manager on Windows.
  • Developer Community 679868: Errors like error APT0000: resource layout/headerLayout (aka com.contoso.androidapp:layout/headerLayout) not found. or *error APT0000: No resource f...
Read more

Xamarin.Android 10.0.0.43

16 Sep 22:39
8af1ca8

Choose a tag to compare

Update September 23, 2019: Xamarin.Android 10.0.0.43 was released as part of Visual Studio 2019 version 16.3 and to the Stable updater channel of Visual 2019 Studio for Mac version 8.3.

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


Earlier information from the Xamarin.Android 10.0.0.43 pre-release

September 16, 2019: Xamarin.Android 10.0.0.43 was released as part of Visual Studio 2019 version 16.3 Preview 4 and to the Preview updater channel of Visual Studio 2019 for Mac version 8.3 Preview.

Issues fixed

Application and library build process

  • GitHub 3564: "error XA3001: Could not link native shared library: libxamarin-app.so" prevented projects from building successfully on the macOS Catalina preview.

Application Mono Framework behavior on device and emulator

This version of Xamarin.Android updates the Mono 6.4 runtime and class libraries from Commit 6434153d to Commit 7af64d1e, adding 15 new commits.

Fixes included for issues reported with Xamarin.Android applications:

  • Developer Community 697733: Starting in the Xamarin.Android 10.0 Preview, "System.ArgumentException: Only 'http' and 'https' schemes are allowed." prevented making HttpClient requests using relative URIs that started with /.
  • GitHub 3397: Starting in Xamarin.Android 9.4, "NotImplementedException" prevented using Stream.CopyToAsync() to copy into a GzipStream.
  • GitHub 3580: The Hebrew locale was incorrectly assigned to use the Gregorian calendar, and leap months in the Hebrew calendar did not have the expected names.
  • Mono GitHub 16369: Starting in Xamarin.Android 9.4, apps that contained large managed assemblies could fail to run on Android 6.0 Marshmallow (API level 23) or higher devices and emulators when built with AOT Compilation enabled.

OSS core

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