Aug 28, 2018 | 4 min read

Overcoming Application Modernization Issues During a Xamarin Upgrade

By: Craig Kaneshiro

Overcoming Application Modernization Issues During a Xamarin Upgrade

Keeping applications up-to-date is important. It allows you to take advantage of the latest framework/component features as they are released, run on the latest devices/platforms, and provide the best user experience possible. Upgrading from one version to the next is usually easier than jumping two or more versions ahead. For these reasons, regular application maintenance to upgrade frameworks and components as they come out is the preferred approach.

Recently, DragonSpears performed upgrades on a Xamarin forms application. The table below lists the component that we upgraded, the old version, and the new version. If you have a Xamarin forms application, these details may assist in performing similar upgrades. If not, this article will still provide an idea of what the general process may look like when upgrading an application that exists on a different tech stack.

Component Old Version New Version
Visual Studio 2015 2017
Android SDK 21 25
SQLite sqlite.net.core-pcl 3.1.1 sqlite-net-pcl 1.4.118
Application Metrics Xamarin Insights Visual Studio App Center

There are existing resources that cover the basics of the upgrade for each component, but as is common with version upgrades that have breaking changes, we ran into 5 challenges not mentioned in the standard documentation.

  1. Component Store discontinuation: As of May 2018, the Component Store was discontinued, so we had to remove components to accommodate the Visual Studio upgrade. Microsoft has provided documentation on how to remove component references and replace them with NuGet packages.
  2. Inability to dynamically link against non-NDK libraries: The Android SDK upgrade resulted in breaking changes because Android 7.0 removed the ability for apps to dynamically link against non-NDK libraries. Here is a complete list of updates in Android 7.0. Xamarin provided a helpful blog post, Preparing for Native Library Linking Changes in Android N, which highlights some of the common changes developers needed to make to upgrade to this version of Android.
  3. Code changes required to accommodate the updated library: The primary change in this application was SQLite compatibility. The application was using Net-PCL packages, which needed to be removed and replaced with the new version. Once the references were updated, there were additional code changes required to accommodate the updated library.
  4. Build settings and emulator compatibility error: When trying to build, there was another error that surfaced related to build settings and emulator compatibility. After some digging, we found this post, couldn’t find “libmondodroid.so”, on the Xamarin forums that provided a resolution.
  5. Retirement of Xamarin Insights: The retirement of Xamarin Insights was the last major hurdle to overcome. Visual Studio App Center replaced it in April 2018, and Microsoft has compiled a great resource to walk through this migration, Visual Studo App Center: the next generation of Xamarin Insights. The process was straightforward, and Visual Studio App Center was receiving data within a few hours of beginning.

Updating application components to the latest versions does require work that can sometimes be easy to put off, but the benefits of keeping applications up-to-date far outweigh the downsides of putting the work off until later. Do you have an application that requires modernization? Contact us to learn more about how DragonSpears can help!