Steps to Create a Xamarin project for Android 6

I had a need to do this recently, so I’ve recording here for posterity (and to help me remember how to do it in the future)…

 

Create a new project in Visual Studio 2017…

 

Set the minimum Android Version to whatever you need…

In my case my app is in a controlled environment that will never be lower than Android 6 (Marshmallow)

 

Select project Properties…

 

Set the “Compile using Android Version” to “Android 6.0 (Marshmallow)”…

This will lead to Visual Studio wanting to reload the project. Let it do this.

 

You’ll now notice an error in the Error List window…..

 

….to resolve this go to “Manage NuGet Packages for Solution”

 

Click on “Xamarin.Android.Support.Design”…

 

Change the Installed Version by Clicking on Checkbox next to the Project name and Changing Version to 22.2.0

then click Install….

 

…Confirm the prompt…

…the error message will then disappear but new problems will show up when you try to build…

 

Remove the folder Resources > mipmap-anydpi-v26 (Right Click and Choose Delete)…

 

Remove the attribute android:roundIcon=”@mipmap/ic_launcher_round” from the <application> element of Properties > AndroidManifest.xml

 

Now Build the solution…

 

The project should now build and be deployable on an Android Device (assuming you have the Android SDK / ADB installed etc – outside of the scope of this tutorial).

 

 

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.