Skip to content

No longer able to access Android.Widget.ChoiceMode when compiling against v2.3 in d15-6 #1170

@pjcollins

Description

@pjcollins

It appears that the ChoiceMode property of Android.Widget.AbsListView https://developer.android.com/reference/android/widget/AbsListView.html#setChoiceMode(int) is no longer accessible when comping against v2.3. This appears to be a regression introduced in d15-6.

Steps to Reproduce

  1. Open the AccessoryViews monodroid sample - https://github.com/xamarin/monodroid-samples/tree/master/AccessoryViews
  2. Ensure you have SDK Platform Version 10 (2.3) installed, and attempt to build the project.

Expected Behavior

The project builds without error when targeting v2.3. This succeeds using d15-5 builds:
https://gist.githubusercontent.com/pjcollins/22ca1e9064404355a0d88e72bb25d929/raw/3d07327d36390d523ac74e1b7d32af4fc63c73f5/15.5%2520Output

Actual Behavior

The project fails to build against monodroid/d15-6:
http://xqa.blob.core.windows.net/gist/report-c995421b88984113bef0729590cdf1cf.txt

(CoreCompile target) -> 
  HomeScreen.cs(31,16): error CS1061: 'ListView' does not contain a definition for 'ChoiceMode' and no extension method 'ChoiceMode' accepting a first argument of type 'ListView' could be found (are you missing a using directive or an assembly reference?) [/Users/xamarinqa/myagent/_work/r1/a/monodroid-samples/AccessoryViews/AccessoryViews.csproj]
  HomeScreen.cs(31,29): error CS0234: The type or namespace name 'ChoiceMode' does not exist in the namespace 'Android.Widget' (are you missing an assembly reference?) [/Users/xamarinqa/myagent/_work/r1/a/monodroid-samples/AccessoryViews/AccessoryViews.csproj]

Interestingly enough, if I update the Target Framework version of my project to v4.0.3 or higher, the type can be resolved and the project builds successfully.

Version Information

https://gist.github.com/pjcollins/03e44af172a79acd68ccf2d25dd129ae

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions