Xamarin.Android 12.2 release notes
| GitHub | Developer Community | System requirements | Blogs |
Installing
Xamarin.Android 12.2 releases are distributed as part of Visual Studio 2022 17.1.
Visual Studio 2022 version 17.1 — Visual Studio Installer (release notes)
Visual Studio 2022 for Mac Preview — Visual Studio for Mac Installer with the Preview updater channel (release notes)
What's new in Xamarin.Android 12.2
Xamarin.Android 12.2 releases
- February 15, 2022 — Xamarin.Android 12.2.0.4
Xamarin.Android version 12.2.0.4
Released February 15, 2022, and included in Visual Studio 2022 version 17.1 and Visual Studio 2022 for Mac Preview.
- IDE Improvements
- Android 12L Preview Bindings
- Application and library build and deployment
- monodroid
- Bindings Projects
- .NET 6 Changes
IDE Improvements
- GitHub Issue 6737: Add " (Preview)" to the "Android Java Library Binding (Preview)" template name to differentiate the .NET 6 template ("Preview") from the Classic Xamarin.Android template. (#6377)
Android 12L Preview Bindings
Bind API-Sv2 Developer Preview 1
(PR #6452, Commit ef011213)Android 12L Developer Preview 1 has been released.
The Android 12L Developer Preview Program Overview Timeline, milestones, and updates section suggests the following timeline:
- October: Developer Preview 1
- December: Beta 1
- January: Beta 2 (Final APIs)
- February: Beta 3
- Q1 2022: Final Release
Application and library build and deployment
Improve reliability of building Xamarin.Android projects in a directory containing non-ASCII characters. (#6273)
Support Android NDK r23b
(PR #6414, Commit 617500c9, PR #6518, Commit d56398b4)Bump SQLite to 3.37.1.
(PR #6530, Commit c52e6e68, PR #6602, Commit 4153fc6f)Note: we encountered an "undocumented breaking change", probably in sqlite/sqlite@c2df4d6a: if a column type is one of a known set of types, then the column type is stored in the bit-field, not as a separate string.
For example, given:
CREATE TABLE TESTTABLE (DATA blob not null)
if you query the type of the
DATA
column, SQLite will now returnBLOB
, whereas previously it would returnblob
; the case is no longer preserved. This broke one of our unit tests, which was fixed by using a case-insensitive comparison.Add
[DynamicDependency]
forAndroidMessageHandler
(#60896, PR #6445, Commit ff202f25)Fixes a
JavaProxyThrowable
unhandled exception because of a nestedMissingMethodException
when running a Release app under .NET 6, asAndroidMessageHandler
was missing a default constructor:UNHANDLED EXCEPTION: Android.Runtime.JavaProxyThrowable: Exception_WasThrown, Android.Runtime.JavaProxyThrowable --- End of managed Android.Runtime.JavaProxyThrowable stack trace --- android.runtime.JavaProxyThrowable: System.Reflection.TargetInvocationException: Arg_TargetInvocationException ---> System.Reflection.TargetInvocationException: Arg_TargetInvocationException ---> System.MissingMethodException: Arg_NoDefCTor, Xamarin.Android.Net.AndroidMessageHandler at System.RuntimeType.CreateInstanceMono(Boolean , Boolean ) at System.RuntimeType.CreateInstanceDefaultCtor(Boolean , Boolean ) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at Android.Runtime.AndroidEnvironment.GetHttpMessageHandler()
Fix methods using
Android.Telephony.Data.*
enums.
(Issue #6527, PR #6535, Commit c4b02d7b)Add
$(AndroidManifestMergerExtraArgs)
.
(PR #6397, Commit 3f347d83)The new
$(AndroidManifestMergerExtraArgs)
MSBuild property allows providingmanifestmerger.jar
options in addition to what the<ManifestMerger/>
task provides (2c6f5cd1), which already emits--main
,--overlays
,--libs
,--placeholder
, and--out
.This allows easily specifying
--log
, if desired:<AndroidManifestMergerExtraArgs>--log VERBOSE</AndroidManifestMergerExtraArgs>
Don't package empty AOT-d DSOs
(Issue #3932, PR #6477, Commit db161ae7)Don't use
java -XX:-UseSplitVerifier
.
(PR #6531, Commit 94e21c7a)The
<JarToXml/>
task usedjava -XX:-UseSplitVerifier
, which is no longer supported on JDK 11. The result is that Android Binding Project builds which still usejar2xml.jar
would fail to build:Unrecognized VM option 'UseSplitVerifier' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
The
-XX:-UseSplitVerifier
option is no longer required. Remove it.Improve
javac -version
version parsing
(PR #6576, Commit a0d83441)$(AndroidNdkDirectory)
is optional
(PR #6539, Commit c96d9f49)Use of AOT and Profiled AOT no longer requires a full Android NDK installation.
Building with LLVM enabled still requires a full NDK installation.
Bump XA0113 warning to API-30
(PR #6548, Commit c35b718d)class-parse.exe
as separate process
(PR #6551, Commit 014c1cb1)Don't skip symbol-less AOT libs
(Issue #6615, PR #6630, Commit d3cd4638)Xamarin.Android 12.2 preview releases had a bug wherein when AOT was enabled and the
$(AndroidAotAdditionalArguments)
MSBuild property contained the valueno-write-symbols,nodebug
, then nolibaot-*.so
files would be added to.apk
or.aab
files. This bug has been fixed.default
$(AndroidUseAssemblyStore)
to false for debug builds
(Issue #1430409, Issue #6480, PR #6660, Commit 19b97b76)
monodroid
Embedded assemblies store
(PR #6311, Commit c9270261, Issue #1578587, PR #6495, Commit cb484d2b)Instead of having separate
.dll
entries in the.apk
, add small set ofassemblies/assemblies*.blob
files, one containing architecture-independent assemblies, and the others containing architecture-specific assemblies. This reduces the amount of processing that must be done at startup.Fix heap overflow detected by a clang sanitizer.
(PR #6435, Commit db7fe5e8)Fix
mono_log_mask
parsing.
(PR #6494, Commit 0f463a1b)Fix
monodroid_dlopen()
to load arbitrary DSOs
(PR #6515, Commit 3329243f, PR #6521, Commit 8b17fbe4)Add new
gref+
,lref+
log options
(PR #6543, Commit 2e499bfd)Allow the
debug.mono.log
system property to accept newgref+
andlref+
values, which will cause JNI Global Reference Messages and JNI Local Reference Messages to be written toadb logcat
.This is not suggested, as it can "lose" messages; it is provided as a "last ditch effort" to obtain GREF logs when the app cannot be rebuilt as a "debuggable" app.
Bindings projects
Rework
generator
type system.
(PR #6436, Commit f658ab26, Commit 43243b4d, PR #6444, Commit 29740ab8)The
generator
type system is used to determine what Java types exist, what methods are added, what methods are overridden, etc. The type system has been updated to improve reliability, with the caveat that this may break things.If your Android Binding Library projects get new errors, please file a bug and then set the
$(_AndroidUseJavaLegacyResolver)
MSBuild property to True.Attempt to better infer Java parameter names from
.class
files whenjavac -parameters
wasn't used.
(PR #6471, Commit dcdcce13, Commit f7d3684d)
.NET 6 Changes
Add a "fast-path" for single-RID builds. Improves incremental build times. (See also: #6308, #6323)
Run per-RID builds in parallel. [#6338]
Don't try "linking" the main app assembly. (#6328)
Properly ignore items with
%(AndroidSkipResourceProcessing)
item metadata. Allows the<ConvertResourceCases/>
task to do less work, improving incremental build times. (#6361)When both
$(ApplicationVersion)
and the/manifest/@versionCode
attribute withinAndroidManifest.xml
values are specified, theAndroidManifest.xml
value takes priority. (#21614, #6384, #6383)The
dotnet publish
command now supports the$(AndroidPackageFormats)
MSBuild property. (#6393, #6403)Prefer /manifest/@package over $(ApplicationId) (#6302, #6304)
improve incremental design-time builds (#6406)
skip C# binding-related targets (#6399)
Fast Deployment under .NET 6 shouldn't select 32-bit ABIs on 64-bit targets.
(Issue #6353, PR #6405, Commit 1ab4f23e)Properly set
$(UseAppHost)
to false.
(PR #6417, Commit e0f3683b)Add
%(Platform)
to any global@(Using)
.
(PR #6447, Commit 4a958fc8)Add non-spamming warning IL6200, née XA2000
(PR #6449, Commit 9f73dc24)Use file scoped namespaces in
dotnet new android
templates.
(PR #6512, Commit f2cb33c0)Don't blindly load Mono components
(PR #6507, Commit 000cf5a8)Add "preview" packs for API 32
(Issue #6176, Issue #6501, PR #6491, Commit daa5254f)exclude
.dll
and.pdb
files from@(None)
or@(Content)
item groups.
(PR #6514, Commit c31b45b1)Profiled AOT can AOT the main assembly.
(PR #6482, Commit 8ac44251)Our default AOT profiles only include assemblies included in the BCL,
Java.Interop.dll
,Mono.Android.dll
, and maybe some AndroidX assemblies.Improve app startup by separately AOT'ing the main assembly when Profiled AOT is enabled. App size increases, but app startup decreases.
Feedback welcome
Your feedback is important to us. If there are any problems with this release, check our GitHub Issues, Xamarin.Android Community Forums and Visual Studio Developer Community for existing issues. For new issues within the Xamarin.Android SDK, please report a GitHub Issue. For general Xamarin.Android experience issues, let us know via the Report a Problem option found in your favorite IDE under Help > Report a Problem.
Open source
Xamarin.Android 12.1 is based on the open-source Xamarin.Android repositories:
- Core JNI interaction logic is in the Java.Interop repo.
- Android bindings and MSBuild tooling are in the xamarin-android repo.
- Chat is in the #android channel on the DotNetEvolution Discord server.