Bug 32835 - [Sample] BatchStepSensor fails to build: Android.Content.PM.PackageManager does not contain a definition FeatureSensorStepCounter or FeatureSensorStepDetector
Summary: [Sample] BatchStepSensor fails to build: Android.Content.PM.PackageManager do...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 0.0 (Samples)
Hardware: Macintosh Mac OS
: High normal
Target Milestone: 6.0 (C6)
Assignee: Jonathan Pryor
Depends on:
Reported: 2015-08-06 13:47 UTC by Ben Beckley
Modified: 2015-08-18 18:07 UTC (History)
2 users (show)

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

proof sshot that it works (141.74 KB, image/png)
2015-08-06 21:45 UTC, Atsushi Eno

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:

Description Ben Beckley 2015-08-06 13:47:11 UTC
This sample is failing to build due to:

>/monodroid-samples/BatchStepSensor/BatchStepSensor/BatchStepSensorFragment.cs(56,56): Error CS0117: `Android.Content.PM.PackageManager' does not contain a definition for `FeatureSensorStepCounter' (CS0117) (BatchStepSensor)


>/monodroid-samples/BatchStepSensor/BatchStepSensor/BatchStepSensorFragment.cs(56,56): Error CS0117: `Android.Content.PM.PackageManager' does not contain a definition for `FeatureSensorStepDetector' (CS0117) (BatchStepSensor)

Reproduction Steps:
1) Open the sample monodroid-samples/BatchStepSensor
2) Attempt to build under any configuration
*Expected Result: project builds without error
*Actual Result: project fails to build due to errors above

Regression Status:
This issue is not occurring with c5sr3 XA 5.1.5-3.
The oldest known build which this occurs is XA 5.1.99-548.


Link to code on GitHub:
Comment 1 Ben Beckley 2015-08-06 14:01:07 UTC
This is also occurring with monodroid-samples/KitKat:

>SensorsActivity.cs(58,75): error CS1061: Type `Android.Content.PM.PackageManager' does not contain a definition for `FeatureSensorStepCounter' and no extension method `FeatureSensorStepCounter' of type `Android.Content.PM.PackageManager' could be found. Are you missing an assembly reference?

Code on GitHub:
Comment 2 Peter Collins 2015-08-06 14:14:07 UTC
Strange, the project does appear to be properly targeting and compiling against API 19, which was when those consts were added.

Diagnostic build output:
Comment 3 Atsushi Eno 2015-08-06 21:45:21 UTC
Created attachment 12400 [details]
proof sshot that it works
Comment 4 Atsushi Eno 2015-08-06 21:45:42 UTC
It does build without any error here as the attached sshot shows.

I read through Peter's build log and the assembly resolution seems fine.

Mono.Android.dll for API Level 19 contains those fields on my environment. You guys might want to make sure that they exist in your environment. It might be that some old versions missed those fields.

I have no idea what's wrong there. It does not seem to be either generator issue or msbuild issue.
Comment 5 Ben Beckley 2015-08-07 12:38:35 UTC
Hello Eno,

I am not seeing the fields in Mono.Android.dll for API Level 19 on my environment: http://screencast.com/t/hqlgkGfjq
They also were not included in other API levels when the general settings target framework was changed (API 21, 22. etc).

And fwiw, here is a gist of a the build output that I am getting: https://gist.github.com/BenBeckley/ab0bc6a752211f485c0f

As you are not able to reproduce this, is there any further investigation I can do on my end?
Comment 6 Peter Collins 2015-08-18 17:42:14 UTC
I'm no longer able to reproduce this with master /  5969ea371df8a. Not sure what ultimately caused this in the first place but it appears to be resolved.
Comment 7 Ben Beckley 2015-08-18 18:07:47 UTC
I am seeing the same thing here and can't reproduce the issue with master / 5969ea37. The assembly references are there again whereas before they were missing, for me at least.