Releases: dotnet/android
.NET 7, Android 33.0.46
These changes shipped alongside Visual Studio 2022 17.6 Preview 3.
You can also access this release via dotnet workload update
.
What's Changed
- [tools/msbuild] Fix System App detection by @dellis1972 in xamarin/monodroid#1284
- [tools/msbuild] Deploy
*resources.dll
from PackageReference by @dellis1972 in xamarin/monodroid#1276 - [monodroid] Prevent overlapped decompression of embedded assemblies by @grendello in #7817
- [Mono.Android] Print type & member remapping info by @jonpryor in #7847
- [Xamarin.Android.Build.Tasks] Remove MAM targets from CoreResolve by @jonpryor in #7868
- [Xamarin.Android.Build.Tasks]
FileWrites
&libraryprojectimports.cache
by @dellis1972 in #7780
Full Changelog: 33.0.26...33.0.46
.NET 8 Preview 2, Android 34.0.0-preview.2.187
How to install?
Download the .NET 8 Preview 2 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 34.0.0-preview.2.187/8.0.100-preview.2 SDK 8.0.100-preview.2
What's Changed
- $(AndroidPackVersionSuffix)=preview.2; net8 is 34.0.0-preview.2 by @jonathanpeppers in #7761
- [ci] Remove classic Mono.Android-Tests runs by @pjcollins in #7778
- [ci] Remove some Classic XA test stages/jobs. by @jpobst in #7770
- [ci] Report issues in the API docs build log by @pjcollins in #7784
- Address issues found by LGTM by @grendello in #7750
- Add
_AndroidLibraryProjectImportsCache
toFileWrites
by @dellis1972 in #7780 - Bump 'InstallAndroidDependenciesTest' to use PlatformTools 34.0.0 by @dellis1972 in #7800
- [Microsoft.Android.Sdk.ILLink] target
net7.0
temporarily by @jonathanpeppers in #7803 - [tests] Bump NUnit versions to latest by @jpobst in #7802
- [MSBuildDeviceIntegration] Fix duplicated test parameter by @jpobst in #7809
- Handle
aapt2
error "The system cannot find the file specified." slightly better by @dellis1972 in #7644 - [build] Only build the latest API level by @pjcollins in #7786
- Add Unit Test for testOnly apps by @dellis1972 in #7637
- [Mono.Android] Update api-compat reference file. by @jpobst in #7822
- Attempt to get better logcat logging for failed tests by @grendello in #7816
- Bump NDK to r25c by @grendello in #7808
- Bump to xamarin/Java.Interop/main@bbaeda6f by @jonpryor in #7799
- Update p/invoke symbol names from net8 alpha1 by @grendello in #7829
- [ci] Run nunit tests with stable .NET version by @pjcollins in #7826
- [ci] Use AZDO built-in parallelization strategy. by @jpobst in #7804
- Try dotnet/java-interop#1046 by @jonpryor in #7824
- [monodroid] Properly process satellite assemblies by @grendello in #7823
- Maybe fix the
unable to open file as zip archive
error by @grendello in #7759 - Remove support for mkbundle by @grendello in #7772
Full Changelog: 34.0.0-preview.1.157...34.0.0-preview.2.187
.NET 8 Preview 1, Android 34.0.0-preview.1.157
How to install?
Download the .NET 8 Preview 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 34.0.0-preview.1.157/8.0.100-preview.1 SDK 8.0.100-preview.1
What's Changed
- $(AndroidPackVersionSuffix)=preview.1; net8 is 34.0.0.preview.1 by @jonathanpeppers in #7392
- [ci] Do not publish .NET 8 packages by @pjcollins in #7399
- Bump manifest-merger from 30.2.2 to 30.3.0 in /src/manifestmerger by @dependabot in #7397
- [readme] Update to emphasize .NET for Android. by @jpobst in #7404
- [One .NET] error with XA1030 for AOT and PublishTrimmed=false by @jonathanpeppers in #7406
- Add local date time offset monovm prop by @mdh1418 in #7331
- [Mono.Android] Add [Flags] to Android.Nfc.NfcReaderFlags. by @jpobst in #7410
- Bump to 32.0.476 .NET 6 Android packages by @jonathanpeppers in #7415
- Bump to dotnet/java-interop@a0728ed5 by @pjcollins in #7420
- [Mono.Android] Improve generated API docs diff by @pjcollins in #7427
- Avoid XA5207 for design-time builds by @dellis1972 in #7434
- Add Gentoo Linux support to OS detection #7441 by @cyborgyn in #7442
- Bump to dotnet/java-interop@e1ee4b1c, xamarin/android-api-docs@bc5443dc by @pjcollins in #7358
- Enable marshal methods support by default by @grendello in #7351
- Bump to xamarin/xamarin-android-tools/main@9f56dec by @jonathanpeppers in #7456
- Bump to xamarin/android-api-docs@52d85154 by @pjcollins in #7459
- [Xamarin.Android.Build.Tasks] Fix up
ToJniName
to use cache. by @dellis1972 in #7460 - Nullability for AndroidMessageHandler.RequestNeedsAuthorization by @mstefarov in #7454
- Bump LLVM to 15.0.3 by @grendello in #7425
- [dependabot] Fix automatic submodule updates by @pjcollins in #7482
- Use Environment.SpecialFolder.UserProfile, not SpecialFolder.Personal by @jonathanpeppers in #7481
- [dependabot] Update submodule ignore list by @pjcollins in #7492
- Bump to .NET 8 by @jonathanpeppers in #7451
- [readme] Be more explicit about support status. by @jpobst in #7494
- Disable loading of libLLVM at runtime by @grendello in #7499
- [build] fix 8.0.100-alpha.1 version band by @jonathanpeppers in #7500
- [Tests] Replace azurestorage with a github repo. by @dellis1972 in #7524
- [xaprepare] use 8.0.100 version band for Mono workloads by @jonathanpeppers in #7530
- [NuGet] Add back the
dotnet7
feed by @grendello in #7534 - [docs] notes on binding
gradle-wrapper.jar
by @jonathanpeppers in #7529 - [build-tools] Update UpdateApkSizeReference scripts to use the right path by @dellis1972 in #7512
- Update MSBuildLocator to include Pre Release by @dellis1972 in #7508
- [DevOps] Rename the yaml-tempaltes resources to match the MAUI repo. by @mandel-macaque in #7533
- [build] Make external build targets more consistent by @pjcollins in #7536
- [readme] Links for d17.4 release. by @jpobst in #7547
- [Mono.Android] Generate API docs for API 33 by @pjcollins in #7472
- [build] push nightly builds to dotnet8 feed by @jonathanpeppers in #7528
- [Xamarin.Android.Build.Tasks] run a Clean if the project path changes. by @dellis1972 in #7476
- [Xamarin.Android.Build.Tasks] Add 'android:exported="true"' to Timing.xml by @dellis1972 in #7551
- [ci] Enable CodeQL on nightly build by @pjcollins in #7522
- [tests] Switch to
httpbin.org
by @dellis1972 in #7556 - [ci] Update PoliCheck exclusions by @pjcollins in #7561
- Try dotnet/android-tools#196 by @jonpryor in #7501
- [SQLite] Bump to version 3.40.0 by @grendello in #7564
- [Build] Log better errors when compiling/linking with binutils by @grendello in #7566
- [docs] how to
dotnet trace
our build by @jonathanpeppers in #7573 - Spelling error by @SwervyK in #7569
- Add API-33 to the nightly build by @dellis1972 in #7552
- Bump to mono/mono@6dd9def5 by @jonpryor in #7574
- Bump to xamarin/monodroid@8c54ea6d by @jonpryor in #7576
- [build] Pass NuGet.config when restoring by @pjcollins in #7578
- Bump manifest-merger from 30.3.0 to 30.3.1 in /src/manifestmerger by @dependabot in #7467
- [Xamarin.Android.Build.Tasks] Don't report duplicate type if the AssemblyName is the same. by @dellis1972 in #7477
- [MSBuildDeviceIntegration] Add nightly localization unit tests. by @dellis1972 in #6693
- fix: AssemblyStoreReader is32Bit flag by @vaind in #7581
- [build] Add support for Visual Studio on win-arm64 by @pjcollins in #7471
- Update .github/CODEOWNERS by @grendello in #7593
- [build] Try building in parallel on Unix by @grendello in #7589
- [DotNet] Attach current thread to MonoVM when registering a type by @grendello in #7560
- [build] Hush a couple of code analyzer warnings for Mono.Android by @grendello in #7591
- [ci] Skip classic tests on release branch PRs by @pjcollins in #7598
- Bump to Android 32.0.485 packs for .NET 6 by @jonathanpeppers in #7602
- [Xamarin.Android.Build.Tasks] avoid
File.Exists()
check by @jonathanpeppers in #7621 - [GH] More updates to CODEOWNERS by @grendello in #7628
- [Xamarin.Android.Build.Tasks] Add XA1031 error for
AndroidHttpClientHandlerType
by @dellis1972 in #7448 - [Xamarin.Android.Build.Tasks] Fix aapt_rules.txt corruption by @dellis1972 in #7587
- Bump to xamarin/monodroid@c0c933b7 by @jonpryor in #7633
- [Xamarin.Android.Build.Tasks] Add support for webp files in AutoImport by @dellis1972 in #7601
- [Xamarin.Android.Build.Tasks] perf improvements for LlvmIrGenerator by @jonathanpeppers in #7626
- [ci] Fix Designer test paths by @jpobst in #7635
- [Xamarin.Android.Build.Tasks] use %(TrimmerRootAssembly.RootMode) All by @jonathanpeppers in #7651
- [build] skip provisioning of Xamarin.Android on .NET lanes by @jonathanpeppers in #7646
- [Xamarin.Android.Build.Tasks] fast path for
<CheckClientHandlerType/>
by @jonathanpeppers in #7652 - [Xamarin.Android.Build.Tasks] delay ToJniName calls in ManifestDocument by @jonathanpeppers in #7653
- [Xamarin.Android.Build.Tasks] fix cases of missing
@(Reference)
by @jonathanpeppers in #7642 - [Xamarin.Android.Build.Tasks] downgrade d8/r8
warning
messages toinfo
by @jona...
.NET 7 (.NET MAUI SR 2), Android 33.0.26
These changes shipped alongside Visual Studio 2022 17.5 Preview 3 and .NET MAUI 7.0.58.
You can also access this release via dotnet workload update
.
What's Changed
- [tests] Replace azurestorage with a github repo by @dellis1972 in #7524
- [Xamarin.Android.Build.Tasks] Fix up ToJniName to use cache by @dellis1972 in #7460
- Bump external/android-api-docs from 52d8515 to bfbe38e in #7483
- [monodroid] Disable loading of libLLVM at runtime by @grendello in #7499
- [tests] Switch to httpbin.org by @dellis1972 in #7556
- [monodroid] Attach current thread to MonoVM when registering a type by @grendello in #7560
- [Xamarin.Android.Build.Tasks] Fix XA4215 if AssemblyName is the same by @dellis1972 in #7477
- [Xamarin.Android.Build.Tasks] Useful errors when using binutils by @grendello in #7566
- [ci] Skip classic tests on release branch PRs by @pjcollins in #7597
- Bump to Android 32.0.485 packs for .NET 6 by @jonathanpeppers in #7615
- [ci] Fix Designer test paths by @jpobst in #7635
- [Xamarin.Android.Build.Tasks] perf improvements for LlvmIrGenerator by @jonathanpeppers in #7626
- [Xamarin.Android.Build.Tasks] delay ToJniName calls in ManifestDocument by @jonathanpeppers in #7653
- Bump to xamarin/java.interop/release/7.0.1xx@4a79bea by @jonathanpeppers in #7671
Full Changelog: 33.0.4...33.0.26
.NET 7 GA, Android 33.0.4
What's Changed
- [ci] Add EXE files to windows-toolchain-pdb artifact by @pjcollins in #7279
- $(AndroidPackVersionSuffix)=rc.2; net7 is 33.0.0.rc.2 by @jonathanpeppers in #7283
- [marshal methods] Part 3 of ? by @grendello in #7163
- [Mono.Android] add "built-in" delegate for MAUI+non-Shell by @jonathanpeppers in #7267
- Bump LZ4 to v1.9.4 by @grendello in #7262
- [AOT] Pass the
hybrid
option to AOT compiler, if enabled by @grendello in #7263 - Bump r8 from 3.3.28 to 3.3.75 in /src/r8 by @dependabot in #7292
- [xaprepare] Generate SourceLink.json by @jonpryor in #7298
- Bump to dotnet/java-interop@e31d9c62 by @jpobst in #7266
- [tests] disable
$(_FastDeploymentDiagnosticLogging)
in PerformanceTest by @jonathanpeppers in #7307 - Bump XAT for new LibZipSharp by @grendello in #7309
- Bump to xamarin/java.interop/main@4f813cb2 by @jonpryor in #7308
- [tests] Use
$(AndroidSdkPlatformToolsVersion)
=33.0.3 by @jonpryor in #7320 - [ci] Skip classic tests on .NET release branches by @pjcollins in #7312
- [ci] Add support to net7.0 for multi-targeting in VS by @pjcollins in #7311
- [ci] Split up signing for files to be notarized by @pjcollins in #7321
- [Mono.Android] Improve the GetHttpMessageHandler function by @simonrozsival in #7214
- [FabricBot] Apply 'needs-triage' label to new issues. by @jpobst in #7327
- [One .NET] fix
dotnet run -c Release
by @jonathanpeppers in #7341 - Don't use Dictionary<K,V> to avoid duplicate value exception by @grendello in #7340
- [FabricBot] Add 'possibly-stale' GH label for closing old issues. by @jpobst in #7343
- [xaprepare] CGManifest.json conforms to JSON schema by @jonpryor in #7342
- Bump SQLite to v3.39.3 by @grendello in #7337
- Marshal methods part 4 of 5 (runtime) by @grendello in #7285
- Bump NDK to r25b by @grendello in #7305
- Update the VSCode Task to use net7.0-android by @dellis1972 in #7268
- [tests] update times in MSBuildDeviceIntegration.csv by @jonathanpeppers in #7347
- [Mono.Android] Improve server certificate custom validation callback integration to cover hostname mismatch by @simonrozsival in #7246
- [One .NET] add XA1029 for $(AotAssemblies) by @jonathanpeppers in #7344
- [Xamarin.Android.Build.Tasks] Use binutils for Aot and LLVM by @pjcollins in #6901
- Bump to dotnet/installer@dd355bb 7.0.100-rc.2.22457.6 by @jonathanpeppers in #7360
- Localized file check-in by OneLocBuild Task: Build definition ID 11410: Build ID 6664168 by @vs-mobiletools-engineering-service2 in #7364
- [dependabot] Automatically update a few submodules by @pjcollins in #7361
- [templates] add
ide.host.json
files by @jonathanpeppers in #7349 - [tests] export $DOTNET_gcServer as 0 by @jonathanpeppers in #7363
- [templates] fix broken/wrong item template contents by @jonathanpeppers in #7366
- AndroidLinkResources and Styleables by @dellis1972 in #7306
- [linker] preserve interfaces on Java types by @jonathanpeppers in #7204
- [Xamarin.Android.Build.Tasks] Feature for excluding Kotlin-related files from apps by @dellis1972 in #7356
- Bump monodroid to bring in Kotlin filter changes by @dellis1972 in #7370
- [ci] Fix test categories for emu smoke tests by @pjcollins in #7374
- Bump to mono/mono@a96bde97 by @jonpryor in #7372
- Bump to Tessil/robin-map@784245b4 [v1.0.1] by @jonpryor in #7382
- Bump to xamarin/xamarin-android-tools/main@0be567a9 by @jonpryor in #7383
- Bump to xamarin/monodroid@135be73 by @jonathanpeppers in #7384
- LEGO: Pull request from juno/hb_6dddf33b-c6da-43d8-ac04-14d2c339cb00_20220916093342545 to main by @csigs in #7385
- Bump to xamarin/Java.Interop/main@fcc33ce2 by @jonpryor in #7380
- Parse cookies on redirect (legacy AndroidClientHandler) by @dominik-weber in #7373
- [docs] Document how to debug JNI Object Reference crashes by @jonpryor in #7362
- Bump to xamarin/monodroid@8f925e33 by @jonpryor in #7387
- $(AndroidPackVersionSuffix)=rtm; net7 is 33.0.0.rtm by @jonathanpeppers in #7393
- Use LLVM toolchain compressed with UPX by @grendello in #7412
- Update .NET 7 AOT profiles by @jonathanpeppers in #7452
- [release/7.0.1xx] stable 33.0.x branding by @jonathanpeppers in #7453
Full Changelog: 33.0.0-rc.1.151...33.0.4
.NET 7 RC 1, Android 33.0.0-rc.1.151
- Android 13 (API-33) Bindings
- App build system changes
- Runtime Optimizations
- Debugger
- Mono.Android
- Templates
Android 13 (API-33) Bindings
Android 13 adds a number of new APIs in
API-33, which are now available when
by setting $(TargetFramework)
=net7.0-android33.0.
App build system changes
-
New LLVM-based toolchain
(PR #6683,
Commit b21cbf94,
PR #6946,
Commit e1f2198e,
PR #6921,
Commit 16bbf6f0)Previously, Xamarin.Android used the GNU Binutils toolchain to compile and
link native assembler code contained in e.g.libxamarin-app.so
.
We are now using LLVM 14 instead of GNU Binutils. -
Bump manifest-merger 30.2.2
(PR #7238,
Commit becca174) -
Bump to xamarin/java.interop/main@032f1e71
(Issue #335,
Issue #954,
Issue #976,
Issue #981,
Issue #992,
PR #7157,
Commit 59352f83,
Issue #969,
Issue #982,
Issue #984,
PR #7180,
Commit ace5f71c,
Issue #7234,
PR #7266,
Commit fe619530)Kotlin-related binding fixes.
Fix
generator
so that when a Javaabstract
method is annotated with@Deprecated
,
the corresponding binding is attributed with[Obsolete]
.generator
now emits a BG8403 warning when a bound type has the same name as its
enclosing namespace name-part, e.g.Example.View.View
.generator
can now emit[ObsoletedOSPlatformAttribute]
. -
Fix for a compatibility issue between AOT and LLVM 14
(PR #6946,
Commit e1f2198e) -
Exclude proguard files from .NET packs
(PR #6985,
Commit bca381f0) -
support building net6.0-android apps in .NET 7
(PR #6988,
Commit fd47b027) -
add win-arm64 support to the workload
(Issue #1544836,
PR #7037,
Commit ac5bb6b9) -
pack
.aar
files in@(AndroidLibrary)
references into the.nupkg
(Issue #7040,
PR #7045,
Commit 868ef054) -
default $(EnableSingleFileAnalyzer) to true again
(PR #7177,
Commit 74c57efd) -
fix $(DebuggerSupport) for Release builds
(PR #7176,
Commit 822667f4) -
Generate LLVM IR, not native asm
(PR #6853,
Commit 5271f3e1) -
Fix LayoutBinding under AndroidX
(Issue #6893,
PR #6894,
Commit bfc68172) -
Add
%(AndroidJavaSource.Bind)
(PR #5926,
Commit 67ce902c)Update the
@(AndroidJavaSource)
Build action:-
Starting with .NET 7, all
**\*.java
files are automatically added to the
@(AndroidJavaSource)
Build action. -
Add
%(AndroidJavaSource.Bind)
item metadata, a boolean value
(default is True) which controls whether or not the file is
compiled and bound prior to the C# build.
The combination of these means that custom Java code can be added to
any .NET Android project, and a binding of that Java code will be
usable by the C# code. Both Java code and bindings will be included
in App builds of referencing apps.There are some restrictions on the Java code. You can only use Java
types or types which are defined in.jar
or.aar
files referenced
by the project via@(AndroidLibrary)
or@(EmbeddedJar)
. It is
suggested that you do not havepublic
Java types which use Java
generics. As with normal bindings, Java generics can cause
significant problems; try to stuck to normal types if you can. -
-
JavaToolTask Error Reporting
(Issue #7009,
PR #7012,
Commit b002dc38)Improve reporting of error messages generated by Java tooling.
-
@(AndroidJavaSource)
& parameter names
(PR #7046,
Commit 6b43af37)Import parameter name information from
@(AndroidJavaSource)
when
%(Bind)
is True. -
Handle Empty R.txt file.
(Issue #1439405,
PR #7133,
Commit 57f280c5) -
Remove deprecated DX & ProGuard code
(PR #7135,
Commit dbadf130) -
fix
@(LibraryProjectZip)
and NuGets
(PR #7151,
Commit f149c25c) -
Use ProGuard config files from .aar files.
(Issue #3752,
PR #5310,
Commit c537dd28) -
Pass
hybrid
to AOT, if enabled
(Issue #7088,
PR #7263,
Commit 92c290be)
Runtime Optimizations
- Enable lazy loading of AOT'd assemblies
([Issue #6935](https://github.com/xamarin/xamarin-androi...
Xamarin.Android 11.2.99.192 [11.3 Preview]
- Application build and deployment
- Preview bindings for Android 12 Developer Preview 2
- Binding project build
- Notable issues fixed
Application build and deployment
-
Developer Community 1288717:
Support Fast Deployment for System Applications.
Added support for fast deployment while building system based
applications. Applications developed in this mode need to be
signed with a platform key and set
/manifest/@android:sharedUserId
toandroid.uid.system
withinAndroidManifest.xml
:<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.system" …> </manifest>
-
Developer Community 1363149:
System.ArgumentException
when%PATH%
or%PATHEXT%
contain"
. -
GitHub PR 5304:
Add support for producing a ProGuard mapping.txt file to the build system.
This file can be used by users to remove this warning:"This App Bundle contains Java/Kotlin code, which might be obfuscated."
... when uploading packages to the Google Play Store.
In order to opt-in to this behavior, set the
AndroidProguardMappingFile
MSBuild property in your project file to the path of the file you want
generated:<PropertyGroup> <AndroidProguardMappingFile>$(OutputPath)\mapping.txt</AndroidProguardMappingFile> </PropertyGroup>
-
GitHub PR 5327:
Allow users to specify additional app bundle "modules" when
building using$(AndroidPackageFormat)
set toaab
. -
GitHub Issue 5562:
FixNullReferenceException
from<LinkAssembliesNoShrink/>
task. -
GitHub Issue 5627:
Allow multipler-classes.jar
files to be included in a build. -
GitHub Issue 5633:
Support$(AndroidUseInterpreter)
under .NET 6. -
GitHub Issue 5710:
Command too long
error when deploying an app with lots of localization assemblies. -
GitHub Issue 5723:
BuildVersionCodes.R
had the wrong value. -
GitHub Issue 5751:
On .NET 6, the default value for$(SuppressTrimAnalysisWarnings)
is True. -
GitHub PR 5726:
An external contribution by @mfranke-moba,
which adds support forout
andinout
array parameters in AIDL files.
Fixes GitHub Issue 4717
and GitHub Issue 5079.
Preview bindings for Android 12 Developer Preview 2
This version includes preview bindings for the
second Developer Preview of Android 12 from Google.
See the Android 12 Developer Preview 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 the
$(TargetFrameworkVersion)
to v11.0.99
in the .csproj
file:
<TargetFrameworkVersion>v11.0.99</TargetFrameworkVersion>
Binding project build
-
GitHub Issue 767:
When using@(JavaSourceJar)
,generator
will extract parameter names from the Java source code. -
GitHub Issue 790:
AllowMetadata.xml
files to affect Kotlin visibility. -
GitHub Issue 2745:
error MSB3375
when using@(JavaDocJar)
. -
GitHub Issue 5474:
Fix@(JavaDocJar)
when using JDK 11.
Notable issues fixed
-
GitHub Issue 4929:
Fixmake prepare
on Ubuntu release 20. -
GitHub Issue 5400:
RemoveSystem.Linq.Expressions
usage withinJava.Interop.JniRuntime
. -
GitHub Issue 5409:
On .NET 6, a Debug build ofJava.Interop.dll
causes a Xamarin.Forms app to crash
because of bad typemaps. -
GitHub Issue 5518:
Allow the xamarin/xamarin-android
repo to build on Apple Silicon.
Xamarin.Android 11.2.2.1
Installing
- Visual Studio 2019 version 16.9 Preview — Visual Studio Installer
- Visual Studio 2019 for Mac 8.9 Preview — Visual Studio for Mac Installer with the Stable updater channel
What's new in Xamarin.Android 11.2
Xamarin.Android 11.2 releases
- March 2, 2021 — Xamarin.Android 11.2.0.21 in Visual Studio 2019 version 16.9 and Visual Studio 2019 for Mac version 8.9
Corresponding Visual Studio 2019 Preview release notes
March 2, 2021 — Xamarin.Android 11.2.0.21
This version is included in Visual Studio 2019 version 16.9 and Visual Studio 2019 for Mac version 8.9.
In Xamarin.Android 11.2.0.21
- All enhancements and issues fixed
- Rewritten fast deployment system
- Known Issue: Fast Deployment and
.mdb
files - Application and library build and deployment
- Binding fixes in Mono.Android.dll
- Binding project build
- Better file association for Android manifest syntax errors
- Deprecation of AAPT in favor of AAPT2
- Deprecation of DebugType full and pdbonly
- Deprecation of JavaDocJar Build action
- Removal of ${library.imports:} support in AndroidResgenExtraArgs MSBuild property
UseShortFileNames=false
is no longer supported
Rewritten fast deployment system
The Fast Deployment system has been fully rewritten to improve reliability and performance.
The new system also no longer uses the external drive for the fast deployment files.
All of the files and tooling are now stored in the application's internal directory.
This has an advantage in that when the application is uninstalled, all of the files and
the tooling will be removed as well.
The new system will not work on any devices older than Android 5.0 Lollipop (API level 21),
as it relies on features that only work Android 5.0 and later.
To debug an app running Android older than Android 5.0, disable Fast Deployment
by setting the $(EmbedAssembliesIntoApk)
property to False.
See the Fast Deployment documentation for more details.
Known Issue: Fast Deployment and .mdb
files
The new Fast Deployment mechanism may fail with:
error : Could not find file "…/<somefile>dll.mdb"
See also: #5631
The issue here is that we are trying to fast deploy a file that does not
exist. This is normally only caused when referencing an old NuGet package
or Project which is still using the old Pdb format for debug symbols.
This old format has to be converted into the Mdb format in order for those
debug symbols to be used by the runtime. The new Portable
Pdb
format is fully supported.
The work around is to upgrade the nuget package to a newer version which
is hopefully now using the Portable
format. If it is for a Project
reference you manage, then try changing the DebugType
to be portable
.
If none of that is an option, you can try adding the following to your
application csproj
.
<Target Name="_RemoveMdbFiles" BeforeTargets="_Upload">
<ItemGroup>
<_ResolvedSymbols Remove="**/*.dll.mdb" />
</ItemGroup>
</Target>
Application and library build and deployment
-
Developer Community 1036602, GitHub Issue 5009: Starting in Xamarin.Android 10.2, .pdb files were not included in the APK if the managed linker was enabled.
-
Developer Community 1184573: Xamarin Android falsely saying that Resource does not exist in the current context (CS0103). Duplicate
attr
elements indeclare-styleable
styles were causing the design-time build system to crash. As a result the Resource.designer.cs was not being updated. -
GitHub 2745:
The@(JavaDocJar)
build action would either cause an MSB3375 error,
or wasn't used at all. -
GitHub PR 4614:
Syntax errors inAndroidManifest.xml
always referred to the generated
version of the file (like
obj\Debug\90\android\manifest\AndroidManifest.xml
), even when the syntax
error was also present in the hand-written input
Properties\AndroidManifest.xml
file. Manifest errors are now fixed up to
point to theProperties\AndroidManifest.xml
file. An additional note will
be added to the message to inform the user that the issue might not be in
that file, but might be caused by code. -
GitHub PR 4783: error XA1011: Using ProGuard with the D8 DEX compiler is no longer supported... AndroidLinkTool ... could appear without clues about the responsible MSBuild property in certain cases where
AndroidLinkTool
was empty. Xamarin.Android now provides additional XA1027 and XA1028 build warnings to indicate cases where one of the olderEnableProguard
orAndroidEnableProguard
MSBuild properties is involved. -
GitHub PR 4846:
Starting in [Android 11][0], for Fast Deployment to work on an API 30
device or emulator, the following<queries/>
entries must be present in
AndroidManifest.xml
:<?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.xamarin.android.helloworld"> <uses-sdk android:targetSdkVersion="30" /> <!-- ... --> <queries> <package android:name="Mono.Android.DebugRuntime" /> <package android:name="Mono.Android.Platform.ApiLevel_30" /> </queries> </manifest>
These will be generated if
$(AndroidUseSharedRuntime)
istrue
and
android:targetSdkVersion
is 30 or higher. -
GitHub PR 4966:
An XA1025 error will now be emitted when$(AndroidAotMode)
isHybrid
and one of the targeted ABIs isarmeabi-v7a
:error XA1025: The experimental 'Hybrid' value for the 'AndroidAotMode' MSBuild property is not currently compatible with the armeabi-v7a target ABI. To continue using the experimental 'Hybrid' value for 'AndroidAotMode', deselect the armeabi-v7a target ABI in the Visual Studio project property pages or edit the project file in a text editor and remove 'armeabi-v7a' from the 'AndroidSupportedAbis' MSBuild property.
Projects using the experimental
Hybrid
value for theAndroidAotMode
MSBuild
property that also include the valuearmeabi-v7a
in theAndroidSupportedAbis
MSBuild property will now see this build error to help indicate that
applications built with these settings would abort during startup on armeabi-v7a
ABI device environments (GitHub Issue 1218).If armeabi-v7a device compatibility is required for the app, the
AndroidAotMode
MSBuild property should be set toNormal
or removed from the
project file completely. To adjust the value of theAndroidAotMode
MSBuild
property, edit the project file in a text editor.If armeabi-v7a device compatibility is not required for the app, then deselect
the armeabi-v7a target ABI in the Visual Studio project property pages to
resolve the build error.In Visual Studio, the target ABIs can be adjusted under Supported
architectures in the Advanced section of the Android Options tab of
the project property pagesIn Visual Studio for Mac, the target ABIs can be adjusted under Supported
ABIs in the Advanced tab of the Android Build section of the project
property pages.Alternatively, edit the project file in a text editor and remove
armeabi-v7a
from theAndroidSupportedAbis
MSBuild property by hand. -
GitHub PR 5188: Improve performance by lazily loading an Android resource mapping file that is only used for error messages. This reduced the overall build time by 348 milliseconds in a real-world project in an initial clean build or incremental builds with Android resource changes.
-
GitHub Issue 4996: application deploy on Android 11 emulator fails with Mono.AndroidTools.AdbException: secure_mkdirs failed: Permission de...
Xamarin.Android 11.1.99.168 Preview
What's new in Xamarin.Android 11.2
November 10, 2020 — Xamarin.Android 11.1.99.168 was published as part of Visual Studio 2019 version 16.9 Preview 1 and Visual Studio 2019 for Mac version 8.9 Preview 1.
Corresponding Visual Studio 2019 Preview release notes
What's new
- Build and deployment performance
- Rewritten fast deployment system
- Deprecation of DebugType full and pdbonly
- Deprecation of AAPT in favor of AAPT2
- Better file association for Android manifest syntax errors
- Removal of ${library.imports:} support in AndroidResgenExtraArgs MSBuild property
UseShortFileNames=false
is no longer supported- Notable issues fixed
- All enhancements and issues fixed in Xamarin.Android 11.2
- Other changes in Xamarin.Android 11.2
- Thank you
- Installing
- Open source
Deprecations, removals, and default configuration changes
- Deprecation of DebugType full and pdbonly
- Deprecation of AAPT in favor of AAPT2
- Better file association for Android manifest syntax errors
- Removal of ${library.imports:} support in AndroidResgenExtraArgs MSBuild property
UseShortFileNames=false
is no longer supported
Build and deployment performance
GitHub PR 5188: Improve performance by lazily loading an Android resource mapping file that is only used for error messages. This reduced the overall build time by 348 milliseconds in a real-world project in an initial clean build or incremental builds with Android resource changes.
Rewritten fast deployment system
As part of this update, the fast deployment system used for Debugging apps has been changed. The shared runtime and shared platform packages are no longer used or required.
The new system also no longer uses the external drive for the fast deployment files. All of the files and tooling are now stored in the application's internal directory. This has an advantage in that when the application is uninstalled, all of the files and the tooling will be removed as well.
The new system will not work on any devices older than Android 5.0 Lollipop (API level 21). This is because it relies on features that only work from API level 21 onwards. Also API level 21 is the lowest supported platform for the runtime, so running and debugging on older devices will be impossible.
See Documentation for more details.
Deprecation of DebugType full and pdbonly
warning XA0125: 'AndroidApp1.pdb' is using a deprecated debug
information level. Set the debugging information to Portable in the
Visual Studio project property pages or edit the project file in a
text editor and set the 'DebugType' MSBuild property to 'portable' to
use the newer, cross-platform debug information level. If this file
comes from a NuGet package, update to a newer version of the NuGet
package or notify the library author.
Support for .mdb or .pdb symbols files that were built with the DebugType
MSBuild property set to full
or pdbonly
is now deprecated. This applies to .mdb and .pdb files in application projects as well as in referenced libraries, including NuGet packages.
Set DebugType
to portable
in the application project as well all library references. portable
is the recommended setting for all projects from now on. The older full
and pdbonly
settings are for older Windows-specific file formats. .NET 6 and higher will not support those older formats.
In Visual Studio, go to Properties > Build > Advanced in the project property pages and change Debugging information to Portable.
In Visual Studio for Mac, go to Build > Compiler > Debug information in the project property pages and change Debug information to Portable.
If the problematic symbol file comes from a NuGet package, update to a newer version of the package or notify the library author.
Deprecation of AAPT in favor of AAPT2
warning XA1026: Using AAPT is deprecated in favor of AAPT2. Please enable 'Use incremental Android packaging system (aapt2)' in the Visual Studio project property pages or edit the project file in a text editor and set the 'AndroidUseAapt2' MSBuild property to 'true'.
Google has deprecated the AAPT command-line tool in favor of AAPT2 going forward. Xamarin.Android has accordingly now deprecated <AndroidUseAapt2>false</AndroidUseAapt2>
as well.
Update the AndroidUseAapt2
MSBuild property to true
to select AAPT2. This property corresponds to the Use incremental Android packaging system (aapt2) setting in the Visual Studio project properties pages. Alternatively, remove <AndroidUseAapt2>
from the .csproj file to let the build select the default value true
.
Important: 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.
If needed, the --legacy
switch can run AAPT2 in an AAPT compatibility mode. Add the following to your .csproj file:
<PropertyGroup>
<AndroidAapt2CompileExtraArgs>--legacy</AndroidAapt2CompileExtraArgs>
</PropertyGroup>
Better file association for Android manifest syntax errors
Syntax errors in AndroidManifest.xml previously always referred to the generated version of the file (like obj\Debug\90\android\manifest\AndroidManifest.xml), even for syntax errors that were also present in the manually configured input Properties\AndroidManifest.xml file. Android manifest errors are now fixed up to point to the Properties\AndroidManifest.xml file. The errors also now include a note to inform users that manifest generation attributes in source code files can be responsible for the errors in some cases.
Removal of ${library.imports:} support in AndroidResgenExtraArgs MSBuild property
A text templating feature for AAPT and AAPT2 has been removed that provided a workaround for the Amazon Fire Phone:
<AndroidResgenExtraArgs>-I ${library.imports:eac-api.jar} -I ${library.imports:euclid-api.jar}</AndroidResgenExtraArgs>
The ${library.imports:...}
syntax should no longer be needed by modern Android libraries. .aar files are the recommended way for Java/Kotlin libraries to distribute Android resources to be consumed by Xamarin.Android application projects.
Note that the AndroidResgenExtraArgs
and AndroidAapt2LinkExtraArgs
MSBuild properties will continue to pass additional arguments to aapt
and aapt2 link
with the ${library.imports:...}
syntax removed.
UseShortFileNames=false
is no longer supported
In previous versions of Xamarin.Android, you could set the UseShortFileNames
MSbuild property in your .csproj file:
<PropertyGroup>
<UseShortFileNames>false</UseShortFileNames>
</PropertyGroup>
This would tell Xamarin.Android's MSBuild targets to use the "long" folder names such as:
- obj\Debug\lp -> __library_projects__
- obj\Debug\lp*\jl -> library_project_imports
- obj\Debug\lp*\nl -> native_library_imports
This was useful when UseShortFileNames
was a new feature, giving developers a way to "opt out" if they hit a bug. However, UseShortFileNames
has defaulted to true
since around July 2017 to help with the Windows API maximum path length limitation.
This functionality has been removed from Xamarin.Android. Short file names will be used going forward.
Notable issues fixed
Application and library build and deployment
- Developer Community 1184573: Xamarin Android falsely saying that Resource does not exist i...
Xamarin.Android 11.1.0.17
November 10, 2020 — Xamarin.Android 11.1.0.17 was published as part of Visual Studio 2019 version 16.8 and Visual Studio 2019 for Mac version 8.8.
Corresponding Visual Studio 2019 release notes
What's new compared to Xamarin.Android 11.0
- Build and deployment performance
android:extractNativeLibs
set to"true"
by default- Corrected garbage collection behavior for Android bindings and bindings projects
- apksigner from Android SDK Build-Tools 30.0.3 now included
- Default Android SDK Platform-Tools version update to 30.0
- Deprecation of Android Wear references in app projects
- Soft deprecation of undocumented ProguardConfigFiles MSBuild property
- Issues fixed and other small changes
- Thank you
- Installing
- Open source
Deprecations, removals, and default configuration changes
android:extractNativeLibs
set to"true"
by default- apksigner from Android SDK Build-Tools 30.0.3 now included
- Default Android SDK Platform-Tools version update to 30.0
- Deprecation of Android Wear references in app projects
- Soft deprecation of undocumented ProguardConfigFiles MSBuild property
Build and deployment performance
GitHub PR 4975: Cache the results of the FilterAssemblies
MSBuild task in memory so they can be reused across different MSBuild targets during the build. This decreased incremental build times for the Xamarin.Forms source build from about 170 milliseconds to about 100 milliseconds on a test system. The savings will be bigger on larger solutions.
android:extractNativeLibs
set to "true"
by default
Starting in Xamarin.Android 11.0, projects that had references to the Xamarin.AndroidX NuGet packages or that were otherwise configured to use the improved manifest merging option would get a value of "false"
by default for the android:extractNativeLibs
Android manifest attribute due to changes in the latest version of the manifest merger tool from Google. Because this value had previously been "true"
when left blank, this could cause unexpected behavior changes for Xamarin.Android applications. Xamarin.Android now sets this attribute to "true"
by default even when using the improved manifest merging.
According to the Android documentation, extractNativeLibs
affects APK size and install size:
Whether or not the package installer extracts native libraries from the APK to the filesystem. If set to
false
, then your native libraries must be page aligned and stored uncompressed in the APK. No code changes are required as the linker loads the libraries directly from the APK at runtime.
This is a tradeoff that each developer should decide upon on a per-application basis. Is a smaller install size at the cost of a larger download size preferred?
Xamarin.Android now emits android:extractNativeLibs="true"
by default, preferring smaller APK sizes. You can get the opposite behavior with an AndroidManifest.xml such as:
<?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.companyname.hello">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" />
<application android:label="Hello" android:extractNativeLibs="false" />
</manifest>
Corrected garbage collection behavior for Android bindings and bindings projects
In previous Xamarin.Android versions, errors similar to JNI DETECTED ERROR IN APPLICATION: use of deleted global reference and JNI ERROR (app bug): attempt to use stale Global 0x2a2a (should be 0x2a26) could cause apps to abort under certain specific timing conditions where a managed garbage collection started just after a Java.Lang.Object
subclass method call.
The Xamarin.Android bindings project build process now includes a fix for this issue.
The set of Android API bindings that are included directly as part of the Xamarin.Android SDK have been updated accordingly to include the fix.
Note: This fix will not solve the problem for other bindings libraries until the libraries are rebuilt using this new Xamarin.Android version. Bindings library authors are therefore encouraged to build and publish new versions of their libraries using this new Xamarin.Android version at their earliest convenience.
apksigner from Android SDK Build-Tools 30.0.3 now included
Xamarin.Android now packages its own copy of the apksigner
executable. The current included version is aligned with Android SDK Build-Tools 30.0.3.
Attempting to use the upstream apksigner
that's packaged in Android SDK Build-Tools 30.0 from the Android SDK Manager with Java JDK 8 results in the following error, as mentioned in the Xamarin.Android 11.0 release notes:
java.lang.UnsupportedClassVersionError: com/android/apksigner/ApkSignerTool has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
The new apksigner
that is now included as part of Xamarin.Android matches the source version of the upstream tool but is built against Java JDK 8 so that Xamarin.Android can now use Android SDK Build-Tools 30.0 alongside Java JDK 8.
Default Android SDK Platform-Tools version update to 30.0
The default Android SDK Platform-Tools version has been updated from 29.0.5 to 30.0.4. This version can be changed per-project if needed via the AndroidSdkPlatformToolsVersion
MSBuild property.
Note: Unlike the Platform-Tools, the default Android SDK Build-Tools version is still 29.0.2 in this release. Projects that attempt to override the AndroidSdkBuildToolsVersion
MSBuild property to a 30.0.x version will currently fail to build with an error similar to:
error XA0032: Java SDK 11.0 or above is required when using Android SDK Build-Tools 30.0.0.
This error will be removed in a future version now that Xamarin.Android provides its own version of apksigner
that is compatible with Java JDK 8. Relatedly, Android SDK Build-Tools version 30.0.2 and higher as provided by the Android SDK Manager are now also compatible with Java JDK 8.
Deprecation of Android Wear references in app projects
Referencing an Android Wear application project from an Android phone application project is now deprecated and will produce a build warning similar to:
warning XA4312: Referencing the Android Wear application project 'com.contoso.wearapp' from an Android application project is deprecated and will no longer be supported in a future version of Xamarin.Android. Remove the Android Wear application project reference from the Android application project and distribute the Wear application as a standalone application instead.
To resolve this warning, remove the reference to Android Wear project from the phone application project and distribute the Android Wear project as a standalone Wear application instead.
Soft deprecation of undocumented ProguardConfigFiles MSBuild property
Xamarin.Android's ProGuard compatibility feature included an undocumented ProguardConfigFiles
MSBuild property that could be used as an alternative to the ProguardConfiguration Build Action. That...