Press ESC to close

Xamarin Forms AndroidX

Hello friends. In this article, after November 2, Play Store will no longer accept applications that do not switch to AndroidX packages. That’s why we need to organize packages in our Xamarin projects. Visual Studio has made a tool to easily switch to AndroidX. When you do Migrate to AndroidX on the Android side, Visual Studio says your packages will now switch to AndroidX. If you have not used too many packages in your project, it does this successfully, but if there are too many packages, the versions of the packages may conflict with each other. This saves you a lot of time.

To switch to AndroidX, we right click on our android project. We see such a screen. When we click the Migrate To AndroidX option from this screen, the packages are transferred to AndroidX.

 

With it, you will see that new packages have been added. There are places you should be careful about here. First of all, he can sometimes be silly. It can especially add pre-release versions of AndroidX packages. This is actually an undesirable situation. That’s why you should check it out. You need to replace them with the latest stable versions.

After migrating packages to AndroidX, you need to check other packages. The most important part here is Firebase packages and Google Play packages. Older versions of these packages may still be using older Android packages. It is also necessary to update them. Of course, you may encounter a ton of deprecated functions here. It is necessary to do it step by step without getting tired.

The last step is to update the namespaces of the packages we have updated. Here, first of all, we need to replace the android.support libraries with the androidx namespacels in the xml parts. After that, it is necessary to check if there is anything left on the .cs side. After completing these processes, you can exit the Play Store.

Before AndroidX updates, if you are using the packages.config system, you need to fix this as well. You can find more information about this process here. For more information about AndroidX updates, you can find Microsoft’s documentation here.

If you have questions, you can reach by comment or e-mail. Good work.

 

Leave a Reply

Your email address will not be published. Required fields are marked *