Could not find android.jar for API Level 26 in Visual Studio 2017

Viewed 22726

Could not find android.jar for API Level 26. This means the Android SDK platform for API Level 26 is not installed. Either install it in the Android SDK Manager (Tools > Open Android SDK Manager...), or change your Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-O\android.jar missing.)

As you can see from below that I have the correct api sdk platforms installed but as you will notice on the error message, it is searching for an android-O directory.

enter image description here

Here is my directory which you will notice has everything in it but doesn't contain android-O

enter image description here

I looked in my visual studio project settings and here is what it shows for target framework

enter image description here Does this mean that Visual Studio 2017 doesn't support Android SDK 26+?

4 Answers

I was getting a similar issue.

Severity Code Description Project File Line Suppression State Error Could not find android.jar for API level 29. This means the Android SDK platform for API level 29 is not installed. Either install it in the Android SDK Manager (Tools > Android > Android SDK Manager...), or change the Xamarin.Android project to target an API version that is installed. (C:\Program Files (x86)\Android\android-sdk\platforms\android-29\android.jar missing.)

The easy fix was to follow the steps mentioned in the error itself from your Visual Studio (I was using Visual Studio 2019).

enter image description here

enter image description here

Click on the Apply Changes button and then reload the project.

Related