-
Notifications
You must be signed in to change notification settings - Fork 528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No longer able to access Android.Widget.ChoiceMode
when compiling against v2.3 in d15-6
#1170
Comments
Therefore this is a bugfix. monodroid-samples should be fixed to not invoke nonexistent method. |
@atsushieno I am not sure about this, perhaps your local documentation is the one that is lying... Here is a java port that has a min, target, and compile version of 10, and successfully uses the following code:
|
Why don't just check sources? |
@atsushieno: It's not Furthermore, <class abstract="false" deprecated="not deprecated" extends="android.widget.AbsListView" extends-generic-aware="android.widget.AbsListView" final="false" name="ListView" static="false" visibility="publi
...
<method abstract="false" deprecated="not deprecated" final="false" name="getChoiceMode" native="false" return="int" static="false" synchronized="false" visibility="public"> The oddity here is that the d15-6 binding of API-10 in # From extracted output of xamarin.android-8.2.0-4.pkg
$ monodis --method .../lib/xbuild-frameworks/MonoAndroid/v2.3/Mono.Android.dll | grep ChoiceMode
# no matches Compare to e.g. 8.1: $ monodis --method /Library/Frameworks/Xamarin.Android.framework/Versions/8.1.2-0/lib/xbuild-frameworks/MonoAndroid/v2.3/Mono.Android.dll | grep ChoiceMode
28486: default class [mscorlib]System.Delegate GetGetChoiceModeHandler () (param: 32420 impl_flags: cil managed )
28487: default int32 n_GetChoiceMode (native int jnienv, native int native__this) (param: 32420 impl_flags: cil managed )
28488: default class [mscorlib]System.Delegate GetSetChoiceMode_IHandler () (param: 32422 impl_flags: cil managed )
28489: default void n_SetChoiceMode_I (native int jnienv, native int native__this, int32 native_choiceMode) (param: 32422 impl_flags: cil managed )
28490: instance default valuetype Android.Widget.ChoiceMode get_ChoiceMode () (param: 32425 impl_flags: cil managed )
28491: instance default void set_ChoiceMode (valuetype Android.Widget.ChoiceMode 'value') (param: 32425 impl_flags: cil managed ) I do not currently understand where the ...and I think I have the cause:
The resulting
The cause of this bug is a301764, which changed |
Android.Widget.AbsListView.ChoiceMode
when compiling against v2.3 in d15-6Android.Widget.ChoiceMode
when compiling against v2.3 in d15-6
ChoiceMode was removed because they were generated from AbsListView fields which DOES NOT EXIST in API Level 10. And getChoiceMode() and setChoiceMode are removed because they expect NONEXISTENT enums. Fortunately they are in ListView in API Level 10, so they can be generated from there. Although, while I can build Mono.Android.dll for the profiles including android-10,
|
To make sure: (1) ChoiceMode being removed in API Level 10 was correct. (2) Leaving ListView.SetChoiceMode() and .GetChoiceMode() to point to non-existent enum and not converting ListView. flelds to ChoiceMode is wrong (only when both conditions are met). |
Context: dotnet/android#1170 Context: dotnet/android#1183 Context: dotnet/android@a301764 Xamarin.Android 8.1 (d15-5) provides an `Android.Widget.ChoiceMode` enum type in API-10+. `ChoiceMode` contains the `android.widget.ListView.CHOICE_MODE_*` constants from API-10, which were moved to `android.widget.AbsListView` in API-15. Xamarin.Android 8.2 (d15-6) inadvertently *removed* the `Android.Widget.ChoiceMode` enum, because [xamarin-android/a301764a][xa-a301764a] altered the mapping of the `CHOICE_MODE` constants so that they were only bound into the `Android.Widget.ChoiceMode` enum for API-15+. [xa-a301764a]: dotnet/android@a301764 [xamarin-android PR #1183][xa-1183] fixes `ChoiceMode` generation so that it applies to API-10+, and in the process alters the API tracked within xamarin-android-api-compatibility. [xa-1183]: dotnet/android#1183 Add the `ChoiceMode` API changes so that [PR #1183][xa-1183] passes the API compatibility tests.
Context: dotnet/android#1170 Context: dotnet/android#1183 Context: dotnet/android@a301764 Xamarin.Android 8.1 (d15-5) provides an `Android.Widget.ChoiceMode` enum type in API-10+. `ChoiceMode` contains the `android.widget.ListView.CHOICE_MODE_*` constants from API-10, which were moved to `android.widget.AbsListView` in API-15. Xamarin.Android 8.2 (d15-6) inadvertently *removed* the `Android.Widget.ChoiceMode` enum, because [xamarin-android/a301764a][xa-a301764a] altered the mapping of the `CHOICE_MODE` constants so that they were only bound into the `Android.Widget.ChoiceMode` enum for API-15+. [xa-a301764a]: dotnet/android@a301764 [xamarin-android PR #1183][xa-1183] fixes `ChoiceMode` generation so that it applies to API-10+, and in the process alters the API tracked within xamarin-android-api-compatibility. [xa-1183]: dotnet/android#1183 Add the `ChoiceMode` API changes so that [PR #1183][xa-1183] passes the API compatibility tests.
Fixes: #1170 Context: a301764 Bumps to xamarin-android-api-compatibility/master/6874e3f3 Xamarin.Android 8.1 (d15-5) provides an `Android.Widget.ChoiceMode` enum type in API-10+, used by the `Android.Widget.ListView.ChoiceMode` property. `ChoiceMode` contains the `android.widget.ListView.CHOICE_MODE_*` constants from API-10, which were moved to `android.widget.AbsListView` in API-15. Xamarin.Android 8.2 (d15-6) inadvertently *removed* the `Android.Widget.ChoiceMode` enum, because [xamarin-android/a301764a][xa-a301764a] altered the mapping of the `CHOICE_MODE` constants so that they were only bound into the `Android.Widget.ChoiceMode` enum for API-15+. [xa-a301764a]: a301764 Removing the `ChoiceMode` enum in turn caused the `ListView.ChoiceMode` property to be removed, as the `ListView.getChoiceMode()` and `ListView.setChoiceMode()` methods expected the (now nonexistent) `ChoiceMode` enum type. Update `map.csv` so that the `CHOICE_MODE_*` values are mapped to the `ChoiceMode` enum in API-10+, not API-15+, which restores the `Android.Widget.ChoiceMode` enum type and the `ListView.ChoiceMode` property.
Verified fixed in monodroid/d15-6/09b922fe. |
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
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
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
The text was updated successfully, but these errors were encountered: