Bug 34710 - BuildVersionCodes.LollipopMr1 enum disappeared
Summary: BuildVersionCodes.LollipopMr1 enum disappeared
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2015-10-09 05:18 UTC by Narcís Calvet
Modified: 2015-10-13 10:48 UTC (History)
2 users (show)

Tags: BZCU
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED ANSWERED

Description Narcís Calvet 2015-10-09 05:18:45 UTC
Android.OS.BuildVersionCodes.LollipopMr1 enum disappeared with 5.1.7.12 update, needed to use "22" value instead. as Android.OS.BuildVersionCodes.Lollipop only covers "21". Need to check if a device is not Lollipop and I'm using this code now:

    private bool NotLollipop()
    {
      return ((Android.OS.Build.VERSION.SdkInt < Android.OS.BuildVersionCodes.Lollipop) || ((int)Android.OS.Build.VERSION.SdkInt > 22));
    }
Comment 1 Al Clark [MSFT] 2015-10-13 10:14:04 UTC
I have tried to replicate using same revision of XA but seems fine for me targeting API 22.

I have emailed Narcís to check that he is targeting API 22 or above.
Comment 2 Narcís Calvet 2015-10-13 10:46:49 UTC
Yes, targeting API 22/23 solves the problem. Targeting 21 doesn't work. It used to work before upgrading to latest stable release.
Comment 3 Atsushi Eno 2015-10-13 10:48:35 UTC
In 5.1.7, we brought a handful of API fixes that were incorrectly generated,
and one of those contained BuildVersionCodes, which contained LollipopMr1 in
assemblies that are lower than API Level 22. That member should not exist in
the Mono.Android API which is supposed to reflect the Android framework API.

So it seems your project's Target SDK Version is below API Level 22, then that is
(unfortunately) expected. If you change the target API Level to >= 22, it will
appear again. Sorry for the inconvenience.