The Xamarin team recently announced that Xamarin.Forms and Xamarin.Essentials have been updated to target Android 13. This aligns with Google's requirement for new Android apps to target at least Android 13 starting from August 2023. The update, which is currently in its preview phase, aims to maintain compatibility with the latest Android version, while paving the way for a seamless transition to the future of cross-platform development: the .NET MAUI framework.
This update aligns Xamarin.Forms and Xamarin.Essentials with MonoAndroid13 by default. Doing so allows developers to leverage the newest features and enhancements offered by Android 13. To facilitate the upgrade process, a preview release has been rolled out, enabling developers to evaluate their apps and prepare for the impending shift.
As Xamarin's support is scheduled to end on May 1, 2024, developers are urged to shift to .NET MAUI, which already supports Android 13. Built to provide a superior cross-platform development ecosystem, .NET MAUI enables a smooth transition from Xamarin to the future of .NET-based development. Developers can rely on detailed upgrade guides and the recently launched .NET Upgrade Assistant extension for Visual Studio 2022 to help them migrate their apps to .NET MAUI.
The Xamarin.Forms update also delivers compatibility improvements for AndroidX binding packages and other dependencies. Although many packages have seen updates, Xamarin.AndroidX.Lifecycle remains at version 2.6.1 because of a known issue currently under investigation. Developers might come across warnings in their build output related to the unknown enum constant Scope.LIBRARY_GROUP_PREFIX. As highlighted in the announcement post by Gerald Versluis, this issue is being looked into.
Before targeting Android 13 with Xamarin.Forms and Xamarin.Essentials, developers must ensure they have Xamarin.Android 13 installed. Next, update NuGet packages to their latest preview versions (Xamarin.Forms 5.0.0.2599-pre1 and Xamarin.Essentials 1.8.0-preview1), and modify the targetSdkVersion in the Android project's AndroidManifest.xml to 33 (Android 13). Finally, rebuilding the project will enable developers to assess their app's features and compatibility.
Xamarin's support for their products ends on May 1, 2024, prompting developers to consider transitioning to .NET MAUI for prospective cross-platform projects. Initiating new projects using .NET MAUI is advisable, while existing Xamarin.Forms projects can be upgraded with the help of the .NET Upgrade Assistant. Comprehensive resources for adopting .NET MAUI are available through their documentation.
Now that Xamarin.Forms and Xamarin.Essentials are targeting Android 13 in preview, developers can benefit from the latest Android features and start preparing for the shift to .NET MAUI. This update guarantees compatibility and provides ample time for developers to transition their projects. Following the preview phase, a stable release is anticipated well before Google's August 2023 deadline for targeting Android 13. Besides Xamarin's support, the AppMaster platform provides a no-code solution for mobile app development, streamlining the process for developers and businesses alike.