Skip to content

.NET 11 RC 1, Android 37.0.0-rc.1.2257

Pre-release
Pre-release

Choose a tag to compare

@jonathanpeppers jonathanpeppers released this 08 Sep 22:22
· 191 commits to main since this release
37.0.0-rc.1.2257
b65b55d

This release is not yet available from the Visual Studio installer. Download the .NET 11 RC 1 SDK, followed by:

> dotnet workload install android
...
Successfully installed workload(s) android.

To verify installation:

> dotnet workload list

Installed Workload Id      Manifest Version                            Installation Source
--------------------------------------------------------------------------------------------
android                    37.0.0-rc.1.2257/11.0.100-rc.1              SDK 11.0.100-rc.1

New Features

Run Android tests with dotnet test

dotnet test can now build, install, and run tests on connected Android devices
or emulators using
Microsoft.Testing.Platform.

The new androidtest project template is configured for MSTest:

dotnet new androidtest -n MyTests
cd MyTests
dotnet test

Running Android tests with dotnet test

You can configure any test framework supported by Microsoft.Testing.Platform
instead. For example, configure NUnit:

builder.ConfigureTestApplication(testApplication =>
    testApplication.AddNUnit(() => [GetType().Assembly]));

Instrumentation-only Android projects can also use dotnet run without
declaring an Activity. This enables headless on-device harnesses such as
BenchmarkDotNet and forwards arguments after -- to the instrumentation
process
(dotnet/android #12261).

Multi-platform test projects are being explored in
dotnet/maui-labs #444.

Faster .NET MAUI Android builds

Several Android build-pipeline changes reduce work in clean and incremental
builds. For a Release CoreCLR .NET MAUI sample-content app using trimmable type
maps, an ordinary managed source change improved from 68.32 to 52.31 seconds,
and an Android manifest change improved from 39.74 to 10.97 seconds. Repeated
no-op builds improved from 4.58 seconds to approximately 3.0-3.5 seconds
(dotnet/android #12229).

Type-map generation also improved from 3,204 to 792 milliseconds in a clean
CoreCLR .NET MAUI sample-content build
(dotnet/android #12279).

Smaller .NET MAUI Android packages

The Android trimmer now removes unused methods from user-defined IJavaObject
types while preserving the constructors and overrides that Java can call. In
the tested ARM64 .NET MAUI app, this reduced package size by 664,926 bytes
without R8 and 718,174 bytes with R8. A minimal app was unchanged
(dotnet/android #12272).

Faster .NET MAUI Android startup with ReadyToRun

CoreCLR Release builds now include most methods from the app assembly in
partial ReadyToRun compilation. The basic .NET MAUI template started 19.8
milliseconds, or 2.4%, faster with a 65,536-byte package-size increase. The
sample-content template started 75.4 milliseconds, or 4.5%, faster with a
266,240-byte increase
(dotnet/android #12248).

.NET MAUI apps can also opt into full ReadyToRun compilation:

<PropertyGroup>
  <MauiEnableFullReadyToRun>true</MauiEnableFullReadyToRun>
</PropertyGroup>

Full compilation trades additional package size for startup performance. The
default remains partial ReadyToRun compilation
(dotnet/maui #37094,
dotnet/android #12299).

Android devices wake before app launch

When dotnet run starts an Android app on a connected device, it now wakes a
sleeping device and dismisses a non-secure keyguard before launching the app
(dotnet/android #12322).

What's Changed

New Contributors

Full Changelog: 37.0.0-preview.7.2131...37.0.0-rc.1.2257