Øyvind Bråthen
Øyvind Bråthen

Reputation: 60694

Can't get Visual Studio to target the correct Android version

I have a problem getting Xamarin.Android to target the newest version of Android.

The problem arised when I tried installing the Xamarin.GooglePlayServices.Maps NuGet package, that required me to run at least Android 8.

From my Android SDK manager, I can see that Android 8 and 8.1 is the only SDK platforms installed:

enter image description here

However, when I start a new project in Visual Studio 2017, and go into the project properties, and extend the Compile using Android version dropdown, it's populated like this:

enter image description here

So here I can choose only 7.1 (that is marked as latest platform), and 8.0 and 8.1 is marked with (Requires installation). Android 7.1 SDK that VS uses is not even installed on my machine.

So the questions is: What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?

Upvotes: 0

Views: 906

Answers (1)

Robbit
Robbit

Reputation: 4358

What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?

In your VS, Tools->Android->Android SDK Manager, you will see Android SDK for VS, it default path is C:\Program Files (x86)\Android\android-sdk.

In your AS, Android SDK's path is C:\Users\user name\AppData\Local\Android\Sdk

Now, you can change the VS's Android SDK's path to C:\Users\user name\AppData\Local\Android\Sdk, but we don't suggest you do that, it may cause VS compilation errors at some point, and by then you cannot find the cause of the problem.

So, you can download the Android 8 from VS again.

Upvotes: 1

Related Questions