Challenges Faced while Building Cross-Platform Apps With Xamarin

Xamarin is the excellent idea or the time efficient tool which is used to build applications for different operating systems and hence overcomes cross-platform development difficulties. Here are the challenges being faced by the Xamarin Forms Developer while building apps with Xamarin:

WPF Platform Setup Challenge

To set up WPF Platform is the most infuriating challenge a Xamarin Forms beginner can face. You launch your IDE, Select Xamarin.Forms project template, but sometimes you can’t run it immediately. This is either due to NUGET packages which are not restored or packages which need to be updated. If you face this issue, the first thing to do is to restore all your nugget packages for the solution and update if need be.

Specified Platform The XAML or the code.

When you are a Xamarin. Forms beginner, and new to .Net development tool, you can get very confused in the beginning. XAML is a markup language used to build user interfaces in .Net apps. You have the choice to build user interfaces either with XAML or with C# code and you may ask yourself if you should use XAML the answer is YES you should. Using XAML allows you to better separate UI code from code logic, and is a better choice when you will implement MVVM.

Where is the designer?

If you have previously worked on mobile development platform like Android or UWP, it is required to have a designer where you drag and drop views. But in Xamarin Forms, there is no requirement of such designer at least not yet. This can seem weird at first and even frustrating. There are some paid solutions for Xaml previewing. I already tried Gorilla Player XAML Live Preview but that was not working for .Net Standard. Finally, I found LiveXaml. Works better than others. Great tool, response is extremely quick. It’s very useful when you want to see the change both on IOS and Android platform at the same time.

Compiling and Running the App.

After restoring packages, in some circumstances, you may find difficulties in compiling and running your app. This bug arises because of platform specific packages that are needed to run the application. For example, after restoring nugget packages, you may face bugs like missing package Xamarin.Android.Support.Design or any other Xamarin.Forms supporting package dispute. Your IDE may complain about Missing References to Dependencies or Packages which are actually PRESENT in your solution or, after running your app, it immediately closes. All of these issues and a lot more will hinder compilation.

Sometimes we have to clean and rebuild the solution again and again to deploy the code. It is such a painful task of cleaning the solution often or deleting the bin and obj folder to remove the cached things and compiling again to rebuild the fresh code.

Dealing with Unhandled Exceptions

Catching unhandled exceptions in Xamarin are quite painful. A mobile application should never exit unexpectedly. That’s why you have to catch unhandled and unobserved task exceptions app-wide. Things are not always what they seem! When an unhandled exception occurs, typically Android will be destroying the process.