Xamarin.Android 12.2 release notes
Xamarin.Android 12.2 releases are distributed as part of Visual Studio 2022 17.1.
What's new in Xamarin.Android 12.2
Xamarin.Android 12.2 releases
- February 15, 2022 — Xamarin.Android 220.127.116.11
Xamarin.Android version 18.104.22.168
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
- Bindings Projects
- .NET 6 Changes
- 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
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)
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
DATAcolumn, SQLite will now return
BLOB, whereas previously it would return
blob; the case is no longer preserved. This broke one of our unit tests, which was fixed by using a case-insensitive comparison.
JavaProxyThrowableunhandled exception because of a nested
MissingMethodExceptionwhen running a Release app under .NET 6, as
AndroidMessageHandlerwas 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()
$(AndroidManifestMergerExtraArgs)MSBuild property allows providing
manifestmerger.jaroptions in addition to what the
<ManifestMerger/>task provides (2c6f5cd1), which already emits
This allows easily specifying
--log, if desired:
java -XX:-UseSplitVerifier, which is no longer supported on JDK 11. The result is that Android Binding Project builds which still use
jar2xml.jarwould fail to build:
Unrecognized VM option 'UseSplitVerifier' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
-XX:-UseSplitVerifieroption is no longer required. Remove it.
Building with LLVM enabled still requires a full NDK installation.
Xamarin.Android 12.2 preview releases had a bug wherein when AOT was enabled and the
$(AndroidAotAdditionalArguments)MSBuild property contained the value
no-write-symbols,nodebug, then no
libaot-*.sofiles would be added to
.aabfiles. This bug has been fixed.
Instead of having separate
.dllentries in the
.apk, add small set of
assemblies/assemblies*.blobfiles, one containing architecture-independent assemblies, and the others containing architecture-specific assemblies. This reduces the amount of processing that must be done at startup.
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.
generatortype 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.
.NET 6 Changes
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)
AndroidManifest.xmlvalues are specified, the
AndroidManifest.xmlvalue takes priority. (#21614, #6384, #6383)
improve incremental design-time builds (#6406)
skip C# binding-related targets (#6399)
Our default AOT profiles only include assemblies included in the BCL,
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.
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.
Xamarin.Android 12.1 is based on the open-source Xamarin.Android repositories: