Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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+?

like image 664
DarthVegan Avatar asked Sep 27 '17 15:09

DarthVegan


People also ask

Could not find Android jar for API level?

jar file could not be found for API level 30. This means that the Android SDK platform for API level 30 is not installed. Install it in the Android SDK Manager (Tools> Android> Android SDK Manager ...), or change the Xamarin. Android project to target an installed API version.

How do I change the minimum Android version in Visual Studio?

Go to android project then right click -> Properties -> Android Manifest (scroll down) then you will see Minimun android version and Target android version.


2 Answers

I discovered that you can fix this issue with 2 steps:

  1. Download and install Visual Studio 2017 Preview by going to https://www.visualstudio.com/vs/preview/

  2. Download and install the Xamarin update extension on both versions of Visual Studio 2017 installed by going to https://developer.xamarin.com/recipes/cross-platform/ide/change_updates_channel/extension-gallery/ and follow the steps

like image 134
DarthVegan Avatar answered Oct 06 '22 19:10

DarthVegan


If you're building for a Xamarin project, you may need to rename the folder in the SDK folder from "android-{alphabetOSVersion}" to "android-{numericOSVersion}" (IE change the folder "android-o" to "android-27").

This should be done in the C:\Program Files (x86)\Android\android-sdk\platforms folder.

like image 43
lyndon hughey Avatar answered Oct 06 '22 21:10

lyndon hughey