You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
Java bindings incorrectly assigning method as obsolete #1142
Java bindings are tagging a method as Obsolete even though the api.xml sets it as not deprecated
Our Java bindings are failing with the following error - Error CS0809 Obsolete member 'MAMIntentService.OnBind(Intent?)' overrides non-obsolete member 'Service.OnBind(Intent?)'
I see the api.xml is correctly tagging the method as not deprecated -
changed the title [-][.NET 8] Java bindings incorrectly assigning method as obsolete on .NET 8 version Android 34.0.0-preview.7.382[/-][+]Java bindings incorrectly assigning method as obsolete[/+]on Sep 1, 2023
The java class Android.App.IntentService does extend Android.App.Service and it's onBind doesn't seem to be deprecated
Agreed, but the issue is MAMIntentService extends IntentService which is deprecated, not Service.
Why does the Java MAMIntentService extend IntentService but the C# MAMIntentService extends Service?
(Note that this feature (like all of generator) works solely on the Java API side. It does not build a C# model so it does not take any C# base classes into account.)
It feels like this feature is working as intended, however there are scenarios where the feature is undesired, and we need to provide a way to opt out of it.
Activity
jonathanpeppers commentedon Sep 1, 2023
/cc @jpobst
jpobst commentedon Sep 1, 2023
My guess would be something to do with #1130.
Can you provide the full
api.xml?Also note that it is simply a warning, and you are likely using some form of "warnings as errors" feature to turn it into an error.
[-][.NET 8] Java bindings incorrectly assigning method as obsolete on .NET 8 version Android 34.0.0-preview.7.382[/-][+]Java bindings incorrectly assigning method as obsolete[/+]Archit-Pikle commentedon Sep 1, 2023
Here's the zip containing the api.xml
api.zip
Thanks for the note. We are treating warnings as errors in our project
jpobst commentedon Sep 1, 2023
It looks like
MAMIntentServiceinherits fromAndroid.App.IntentService:And
Android.App.IntentServiceand itsOnBindare indeed[Obsolete]:The interesting thing is that according to your error message,
MAMIntentServiceis inheritingAndroid.App.Serviceinstead:Are you doing something custom that remaps the base class of
MAMIntentService?Archit-Pikle commentedon Sep 1, 2023
The java class Android.App.IntentService does extend Android.App.Service and it's onBind doesn't seem to be deprecated
https://developer.android.com/reference/android/app/IntentService
https://developer.android.com/reference/android/app/Service#onBind(android.content.Intent)
jpobst commentedon Sep 5, 2023
Agreed, but the issue is
MAMIntentServiceextendsIntentServicewhich is deprecated, notService.Why does the Java
MAMIntentServiceextendIntentServicebut the C#MAMIntentServiceextendsService?(Note that this feature (like all of
generator) works solely on the Java API side. It does not build a C# model so it does not take any C# base classes into account.)It feels like this feature is working as intended, however there are scenarios where the feature is undesired, and we need to provide a way to opt out of it.
[generator] generator --lang-features=do-not-fix-obsolete-overrides (#…
[generator] generator --lang-features=do-not-fix-obsolete-overrides (#…