.NET 11 RC 1, Android 37.0.0-rc.1.2257
Pre-releaseThis 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 testYou 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
- [build] Default interpreter only for MonoVM by @jonathanpeppers in #12208
- [NativeAOT] Migrate runtime utility logging to printf by @simonrozsival in #12148
$(AndroidPackVersionSuffix)=rc.1by @jonathanpeppers in #12214- [tests] Ignore MarshalMethodsAppRuns on CoreCLR by @jonathanpeppers in #12213
- [NativeAOT] Migrate shared GC logging to printf by @jonathanpeppers in #12210
- [xabt] Fix Windows long path directory removal by @jonathanpeppers in #12212
- [tests] Isolate parallel Kotlin Gradle state by @jonathanpeppers in #12217
- [Mono.Android] Move Android documentation notices by @jonathanpeppers in #12220
- [tests] Restore Java.Interop value manager coverage by @jonathanpeppers in #12225
- [tests] Restore GetObjectArray coverage by @jonathanpeppers in #12222
- [CoreCLR] Complete startup-aware lock initialization by @jonathanpeppers in #12219
- [build] Move Android tools projects into src and tests by @jonathanpeppers in #12215
- [build] fix
make prepareon clean agents: empty$(PkgMono_Unix)by @jonathanpeppers in #12231 - [NativeAOT] Migrate GC bridge logging to printf by @jonathanpeppers in #12211
- Move hardcoded Aapt2Compile warning string to Resources.resx for localization by @jonathanpeppers with @Copilot in #12227
- Enable nullable reference types in RtxtWriter.cs by @jonathanpeppers with @Copilot in #12241
- Add XML documentation to SupportsGLTextureAttribute by @jonathanpeppers with @Copilot in #12234
- Remove redundant AsyncTask logging from LinkNativeRuntime by @jonathanpeppers with @Copilot in #12238
- [tests] Fix
TimeZoneInfoTestsfixture: add missing[TestFixtureSource]by @jonathanpeppers in #12246 - [NativeAOT] Add printf gref logging by @jonathanpeppers in #12218
- [Native] Remove unused field weak_handle by @AustinWise in #12239
- [ci] cache Gradle distributions on MSBuild test agents by @jonathanpeppers in #12244
- [Xamarin.Android.Build.Tasks] mostly R2R the main assembly by @jonathanpeppers in #12248
- [TrimmableTypeMap] Improve incremental build performance by @simonrozsival in #12229
- Fix copy-paste bug: targetSdkVersion gated on MinSdkVersion in CreateDynamicFeatureManifest by @jonathanpeppers with @Copilot in #12251
- [tests] Route Maven and Gradle resolution through the dnceng mirror by @jonathanpeppers in #12199
- [Mono.Android] Mark JavaFinalize() as [Obsolete] by @jonathanpeppers in #11424
- [skills] add gh-stack skill for stacked PRs by @jonathanpeppers in #12255
- [CoreCLR] Stabilize Debug typemaps across C# rebuilds by @jonathanpeppers in #12216
- [Xamarin.Android.Build.Tasks] instrumentation-only apps +
dotnet runby @jonathanpeppers in #12261 - Add XML docs for Action-based Java.Lang.Thread constructors by @jonathanpeppers with @Copilot in #12265
- [CoreCLR] Align AddPeer() peer-replacement rule with MonoVM by @jonathanpeppers in #12271
- Apply
*.runtimeconfig.dev.jsonto CoreCLR apps by @jonathanpeppers in #12268 - [Xamarin.Android.Build.Tasks] merge
targetSdkVersioninto existing<uses-sdk>by @jonathanpeppers in #12290 - fix: use thread-safe LogCodedWarning in Aapt2Compile.ProcessDirectory by @jonathanpeppers with @Copilot in #12292
- [perf] guard the _AdditionalJavaStubDirectory glob in _FindJavaStubFiles by @jonathanpeppers in #12287
- [FastDeploy2] fix
adb pushargument quoting on Windows by @jonathanpeppers in #12283 - [tests] fix JcwGen
targetSdkVersionand remove dead.apktest infra by @jonathanpeppers in #12288 - [CoreCLR] Set the RUNTIME_IDENTIFIER runtime property by @jonathanpeppers in #12278
- [LlvmIrGenerator] ~4x faster type map generation by @jonathanpeppers in #12279
- Set APP_CONTEXT_BASE_DIRECTORY on CoreCLR and NativeAOT by @jonathanpeppers in #12282
- [LlvmIrGenerator] emit c"..." literals for string blobs by @jonathanpeppers in #12280
- [ILLink] trim unused Java-callable members by @jonathanpeppers in #12272
- [Xamarin.Android.Build.Tasks] more LLVM IR generator build perf by @jonathanpeppers in #12285
- [workflows] Update gh-aw to v0.84.3 by @jonathanpeppers in #12297
- [build] Brand main builds with release suffix by @jonathanpeppers in #12298
- [tests] Avoid leaking fake emulator processes by @jonathanpeppers in #12300
- [CoreCLR] support MAUI full ReadyToRun by @jonathanpeppers in #12299
- [Mono.Android] Deprecate removed constructors by @jonathanpeppers in #12311
- [android-tools] Align command-line tool discovery order by @jonathanpeppers in #12319
- [XABT] Allow disabling binding XML documentation by @jonathanpeppers in #12321
- Add XML documentation for DatePicker DateTime properties by @jonathanpeppers with @Copilot in #12306
- Remove legacy machine.config resource by @jonathanpeppers in #12317
- [Xamarin.Android.Build.Tasks] Use resolved NDK for AOT by @jonathanpeppers in #12316
- [nightly-fix-finder] Open fixes as pull requests by @jonathanpeppers in #12312
- More thorough check of framework description for .NET 6+ by @Chagrins in #12308
- Enable nullable analysis in LayoutAttribute.Partial.cs by @jonathanpeppers with @Copilot in #12326
- [fix-finder] docs: document Bitmap pixel access APIs by @github-actions[bot] in #12341
- Move MarshalMethodsAssemblyRewriter warning into resources by @jonathanpeppers with @Copilot in #12330
- Wake device before launching Android apps by @jonathanpeppers in #12322
- [ci] Bootstrap Nightly Fix Finder tooling by @jonathanpeppers in #12339
- [debugging] Retry JDWP process lookup by @jonathanpeppers in #12324
- [Microsoft.Android.Run] Await app shutdown on Ctrl+C by @jonathanpeppers in #12318
- [gh-aw] Allow documentation sites in nightly fix finder by @jonathanpeppers in #12344
- [github] Rename Android review skill for Copilot discovery by @jonathanpeppers in #12345
- [Mono.Android] Prevent premature JNI handle collection by @jonathanpeppers in #12315
- Improve Maven POM resolution errors by @jonathanpeppers in #12320
- [CA1310] Specify StringComparison in SdkManager.Licenses.cs by @mauroa in #12346
- [ci] Prevent isolated NuGet access by @jonathanpeppers in #12336
- [java-runtime] Improve native library load diagnostics by @jonathanpeppers in #12313
- [Java.Interop] Fix inherited JCW interfaces by @jonathanpeppers in #12333
- [CoreCLR] Validate Java package and type names by @jonathanpeppers in #12323
- GitHub Actions: Isolate Copilot code review setup by @jonathanpeppers in #12352
- [tests] Keep XASdk restores on approved feeds by @jonathanpeppers in #12338
- [tests] Avoid JSInterop package downgrade by @jonathanpeppers in #12351
- [Mono] Update System.Native p/invoke table by @jonathanpeppers in #12350
- [XABT] Fix stale shrunk assemblies in the llvm-ir typemap path by @BrzVlad in #12342
- [ci] Use repo NuGet config for template smoke build by @jonathanpeppers in #12335
- [generator] Honor metadata JNI signature overrides by @jonathanpeppers in #12340
- [workflows] Update gh-aw to v0.86.2 by @jonathanpeppers in #12349
- [Java.Interop] Cache peer activation constructors by @jonathanpeppers in #12354
- [NativeAOT] Let SDK select ILCompiler version by @jonathanpeppers in #12356
- [tests] Keep GetObjectArray peer alive by @jonathanpeppers in #12357
- [tests] Prevent duplicate logcat messages in uncaught exception test by @jonathanpeppers in #12358
- [tests] Improve apkdiff invocation reliability by @jonathanpeppers in #12361
- [tests] Make DotNetPublish pack assertions deterministic by @jonathanpeppers in #12359
- [tests] Make activity start detection resilient by @jonathanpeppers in #12360
- [generator] Remove deprecated Xamarin fallback paths by @jonathanpeppers in #12364
- [build] Add explicit fast deployment property by @jonathanpeppers in #12363
- [Java.Interop] Make JNI function pointers unconditional by @jonathanpeppers in #12365
- Fix CodeBehind NuGet config placement by @jonathanpeppers in #12367
- [tests] Route XASdk Maven dependency through public feed by @jonathanpeppers in #12368
- Convert solution files to SLNX by @jonathanpeppers in #12375
- Enable CoreCLR R2R for custom publish configurations by @jonathanpeppers in #12366
- Quote Java response file paths by @jonathanpeppers in #12373
- [NativeAOT] Link runtime crypto archive directly by @jonathanpeppers in #12372
- [Mono.Android] Fix JNI local reference disposal with ownership flags by @jonathanpeppers in #12380
- [build] Remove obsolete build tools by @jonathanpeppers in #12376
- Fix Bind=false binding dependencies by @jonathanpeppers in #12381
- [tests] Track evaluation time across performance runs by @jonathanpeppers in #12390
- [main] Bump System.IO.Hashing to 10.0.11 by @jonathanpeppers in #12391
- [main] Bump System.CodeDom from 10.0.10 to 10.0.11 by @jonathanpeppers in #12392
- [fix-finder] Enable nullable annotations for GetGdbSymbols by @github-actions[bot] in #12398
- [fix-finder] Remove obsolete region directives from MonoDroidSdk by @github-actions[bot] in #12399
- [Java.Interop] Avoid locks for cached JNI member lookups by @jonathanpeppers in #12377
- [release/11.0.1xx-rc1] Fix incremental APK archives and NuGet cache writes by @jonathanpeppers in #12463
New Contributors
- @AustinWise made their first contribution in #12239
- @Chagrins made their first contribution in #12308
Full Changelog: 37.0.0-preview.7.2131...37.0.0-rc.1.2257
