Xamarin.Forms 5.0 is Here!
Today we are publishing the latest stable release of Xamarin.Forms, version 5.0. This major release delivers hundreds of quality improvements and brings to stable release new features including App Themes, Brushes, CarouselView, RadioButton, Shapes and Paths, and SwipeView.
The Xamarin team wishes to extend a huge thank you to the many contributors and reviewers that helped make this release. You are amazing!
In past blog posts we have covered features as they previewed, and your feedback has guided us to this stable mark. To explore each new control and experience, check the resources linked below.
Upgrading to 5.0
We have upgraded all our samples, and many of our own projects from versions of Xamarin.Forms going back as far as 3.5 with smooth sailing. There are some things that’ll help you make quick work of the migration. Here’s a quick checklist for success:
- Make sure you’re using Visual Studio 2019. This is the minimum version required.
- UIWebView has been removed to address Apple’s updated guidance. Unless you have intentionally opted-in to UIWebView then you’re already using the newer WKWebView and won’t need to do anything additional.
- MediaElement, Expander, and C# UI markup extensions have been moved to the Xamarin Community Toolkit library. Install this NuGet and update your code accordingly. You’ll probably want this library anyway as it has a lot of valuable solutions every app needs.
- DataPages and Theme packages should be removed from your solutions. These experimental packages are no longer being released.
- (Optional) MasterDetailPage and related types have been renamed to FlyoutPage and similar. This is a deprecation, and your apps will continue to work for now without making this change, however we recommend refactoring before we get to .NET MAUI.
Resources, Documentation, Samples, and Videos
Check the full release notes for complete details about what’s in the release. We also publish a full API change document that is useful.
New documentation is published for the new features, and much more which you can track on the What’s New page.
The official Xamarin.Forms samples are now updated and ready for you to explore Xamarin.Forms 5.0.
These experiments (use at your own risk) from our team may also be interesting to you as you check out the release:
Blogs previewing many of these features may be found here:
- CODE Magazine: Xamarin.Forms 5
- Xamarin.Forms 5 Preview
- Xamarin.Forms Shell Quick Tip: Modal Navigation
- Gradient Brushes
- Shapes and Paths
- App Themes (Dark Mode)
- C# UI Markup
Check out these short tutorials covering these new features on YouTube.
Additionally we have introduced many of the Xamarin.Forms 5.0 content on The Xamarin Show and at .NET Conf 2020.
Update your projects to 5.0 via the NuGet Package Manager, clean, restart VS, and rebuild. Let us know how it goes! If you have any issues, please file a report for us on GitHub.
Xamarin.Forms 5.0 will continue to receive service releases through November 2022. .NET MAUI will be the next major feature release with previews of .NET 6 shipping early this year. Xamarin.Forms 5.0 apps will migrate to .NET 6 and upgrade directly to .NET MAUI. We look forward to continuing this evolution with you in 2021!
After the update from the latest 4.8 to 5 with no code changes the back navigation under android seems to have changed. When I’m in details page and click on the back button in the shell I do get this error in the console:
Same with the android back button. Do I have to adjust something after the update?
Hi Nino, we believe that may be resolved by this PR: https://github.com/xamarin/Xamarin.Forms/pull/13330
Please grab the NuGet from the public build pipeline and confirm. File a new issue for us if that’s not it.
This video shows how to download and use those NuGets. https://youtu.be/tg3pyuIg55k
With version 220.127.116.1121 I downloaded from DevOps I still get the same issue. I added more infos to how I register the routes in the answer to Shane.
PS: what is the name of the song in the youtube video? Pretty catchy, but shazam can’t find it ^^
If you have issues testing the NuGet from the pipeline can you leave a comment here with the syntax you are using to register your Routes?
With version 18.104.22.16821 I downloaded from DevOps I still get the same issue.
In case that helps anything, the project I’m trying this is OpenSource: Repository
The way I register that particular root is with:
ViewModelLocator.AccountListRoute looks like this:
It seems to work with the released version when I change the root to this:
For test purposes you can just start the app, skip the tutorial, go to the statistic via the flyout and choose on of the entries. From there when you try to navigate back you’ll see the error in the console.
Thank you for the response Nino! I updated the PR and tested with the nugets here https://dev.azure.com/xamarin/public/_build/results?buildId=33296&view=results and that appears to have resolved your issue. We should have a service release out here soon
Thanks for having a look at this! I checked the nugets from your linked build and it seems to work as expected.
Can vs2019 choose xamarin 5 by default? Then I don’t have to set the xamarin version every time. Thank you
i was wonderingvthe same. it isnt obvious.
The templates are updated in 16.9/8.9 version of Visual Studio. It’s in the pipeline and headed your way!
Hi and Thank you for your efforts to improve Xamarin Forms and add new features to it . But I want to Criticize Xamarin Forms for it’s Weakness and Limitations to support Right To Left layout. There are many Bugs and Issues related to Right To Left Layout in GitHub , but almost most of them are not solved so far.(like : Radiobutton , RelativeLayout ,Shapes, Brushes , Shell …)
I want to know is there any hope and plan to solve these problems?
Thank you for considering this matter.
Yes, these are important issues to address. Please confirm that your impacting issues are reflected here: https://github.com/xamarin/Xamarin.Forms/issues?q=is%3Aopen+is%3Aissue+label%3Aa%2Frtl
I tried to upgrade to Forms 5.0, but immediately ran into two pretty obvious issue with Shell. The first is that if you have a Shell.FlyoutBackgroundImage it is shown on top of the menu items such that they are not visible. The second is that Shell.TitleView is not shown at all in iOS. I understand that major new releases can have bugs, but these seem like very obvious issues that even relatively basic beta testing should have found. From my point of view, Forms 5.0 is not ready for general usage yet.
Those issues are both addressed and shipping very soon in a service release.
They were identified very late and we decided to not hold the entire release, but instead to quickly ship a service release. We noted the Shell issue in Known Issues.
David, thanks for the reply. I look forward to the service release. I’m definitely excited about Forms 5, and hope it goes smoothly when I try the migration again.
Hello Xamarin team! Xamarin.Forms 5 is released, but what about this problem https://github.com/xamarin/Xamarin.Forms/issues/1944?
I am writing here because we cannot get feedback. Thank.
I have to admit that I didn’t follow the development of Xamarin 5 and its issues very closely, but holy monké of bananasoftware thats a whole new level of disappointment. I cloned Xappy & Los Gatos, Build and Run on a slow but recent Android phone and it seams that Xamarin is something my phone is to Android to understand…
– Drag and Drop in Los Gatos is triggered on long press it seams, but a swipe in a List or Collection doesn’t cancel the long press. So swipping content up and down in one go does trigger the long press. So Drag and Drop is not really unusable in lists.
– Swipe delete doesnt work. Button doesn’t do anything.
– Favorites (heart icon on tile) doesnt do anything.
– Add (plus on tile) doenst work.
– Light bulb button on top in navigation bar to switch theme has a 30% chance to work. No idea why a button has a random chance of not triggering…
– Switching from Settings to Profile Tab will block switching back to Settings, will have to activate an other first.
Xappy App is crashing like a 3 year old plaing my favorite racing game:
– Start App, suspend with home Button => Nullref crash.
– Scenarios > Map shows a permission dialogue just to crash with it.
– About is crashing 100%.
– UIControlls > select anything => no difference in any of the selections.
– UIControlls > select anything > Anchor inputfiled any input that is not a number => little kiddo crashes the haystack again.
– I got about 3 other crashes that I dont remember what I clicked, so this one complaint is just for my mood.
I’m not yet at the point of saying all these issues are Xamarins fault and not also the given examples apps that maybe have issues.
But my confidence of using this product and building a satifying customer app with it, has taken an other blow.
So good luck improving your product and if I’ll get more into it I rephrase my complaints in a more detailed and constructive way in the repo.
But just as a general first impression, that was unfortunately a bummer.
It sounds like your issues are with my sample apps where I test and explore new releases, rather than Xamarin.Forms 5. Yes, there is a lot of stuff in them not implemented. I apologize if I’ve set the expectation that they are production quality apps. Please open issues for me on those repos and I’ll give them a look. I’ve not experienced the issues you’re describing, so some specific feedback on the repos would be awesome.
I think you would be better off exploring the official documentation samples here:
Hi David, I am using VS 2019 community edition 16.8.4 on my SP3 running W10 20H2 with all the latest and greatest patches and updates available for the device. I created a new Xamarin Forms mobile project to test the hot restart on my iPhone 12 pro max running iOS 14.4. My phone appears in the VS project, and I have no issues running it in debug mode. There were no issues with the deployment from the output window, and I got the prompt asking to launch the app on my device to continue.
At first, I couldn’t find App1 on my iPhone. Once I restarted the phone, it appeared. When I launch the app, the splash screen appears, and then it crashes. I tried this on my desktop computer running W10 as well. Same behavior. App1 is just a blank Xamarin Forms mobile app.
This is my first time using Xamarin Forms. I don’t have a MAC device, but I got a paid apple developer account. I have developed apps for Windows Phone 7/8 back in the days, so I wanted to give Xamarin Forms a try. Any idea what could be going on? Anything I could do to investigate this further?
After upgrading Xamarin Forms, from 22.214.171.1240 to the latest version, my iOS app freezes on the splash screen, and I can’t find a reason.
I couldn’t find anything on the debugger, that could give me a hint.
Could anyone give me a tip?