Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Running BasicCalculator sample, I'm getting a compilation error when I build it.
##### Steps to reproduce #####
1. Download https://github.com/xamarin/mobile-samples/tree/master/LivePlayer/BasicCalculator
2. Open VS2017
3. Build solution or Build Calculator.Droid project
##### Expected result #####
The solution/project built fine
##### Current result #####
I'm getting the following error:
> Severity Code Description Project File Line Suppression State
> Error 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. (%PATH_TO_ANDROID_HOME%\platforms\android-O\android.jar missing.) Calculator.Droid
##### Suplemental Info #####
XA version: 220.127.116.11
Environment info: https://gist.github.com/gonzalonm/a4590eda2b7b5d7a4cbe10b7a808079c
One more thing, it's not happening on d15-2. In addition, it's reproducible on both Mac and Windows for d15-3. Changing 'Target Milestone' to d15-3
Last update on this: To avoid this problem, we should remove API26 for now.
I am CONFIRMING this bug because the path is incorrect on lookup. For example, here is another similar error message:
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:\Android\android-sdk\platforms\android-O\android.jar missing.) Calculator.Droid C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 541
The problem here is that the lookup is for "android-O". I believe Google has changed this to "android-26" now that the API is in a second beta. I believe this needs to be reflected in Xamarin.Android.
As a workaround, you could technically copy the "android-26" folder and rename to "android-O" which will succeed the use case you have.
I believe this is fixed in master already and should also be fixed as it seems to work ok on master. I'm not 100% sure which fixes are needed though.  does not appear to be in the d15-3 branch, and there might be others.
Other related commits
The side-effect of this bug is also that project set to use the latest API available will pick up 26 as the version if android-26 is installed (now available in the stable channel so easily installable by users) and thus trigger this issue on build.
Disregard the above comment.
Dean - Is this fix appropriate to ship to everyone for 15.3, or can it wait until API 26 ships?
I have a work around for now
The idea is if we find an API level which is above what we currently support we just use the max supported value.
PR is up https://github.com/xamarin/xamarin-android/pull/688
Fixed in Xamarin-android/master/ad56f8ae
Confirmed the issue using:
> VS Version 15.3.0 Preview 3.0
> Xamarin.Android SDK 18.104.22.168 (5a73b38)
The issue is no longer reproducible with:
> VS Version 15.3.0 Preview 3.0
> Xamarin.Android SDK 22.214.171.124 (master/42ec1af)
Verified fixed in monodroid/d15-3/ebbee99b and VS Version 15.3.0 Preview 4.0 /
Xamarin.Android SDK 126.96.36.199 (ebbee99)
Until this lands, I can confirm Jon's workaround of copying the `android-26` SDK platform and renaming it `android-o`. In my case, it looks like the SDK platforms were in `C:\Program Files (x86)\Android\android-sdk\platforms\`, though.
Unfortunately, completely uninstalling API 26 and/or changing the target SDK version did not resolve this for me. Even with API 26 gone and not targeted, it would still present that deployment error about API 26.
After removing API 26 from disk you would probably need to clean and build since we cache a bunch of items to help speed up the builds.