Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

Do not invalidate binding an interface if a static method cannot be bound #588

Closed

Description

@gugavaro

Currently .Net has a limitation for Actions and Functions to support up to 16 arguments.
When generator hits a case where method has more than 16 arguments it will skip it after providing a warning.

EXEC : warning BG8D00: More than 16 parameters were found, which goes beyond the maximum number of parameters. (in method Of in managed type Java.Util.IMap)

The problem is that after ignoring the issue, Generator also invalidate the whole type because it contains invalid methods.

EXEC : warning BG8503: Invalidating Java.Util.IMap and all nested types because some of its methods were invalid.

We are hitting this case when trying to bind some static methods on Interface java.util.Map<K, V>

https://developer.android.com/reference/java/util/Map#of(K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V,%20K,%20V)

We need to not treat those warning as warning since it causes us problems later.
When dealing with methods that have more than 16 arguments, we may need to create our own type/delegate.

Activity

  1. jpobst commented on Mar 2, 2020

    @jpobst
    Contributor

    To clarify, I believe the issue here is we do not need to invalidate the interface if we cannot bind a static or default method, as these are not required to be implemented by the user in order to implement the interface.

  2. added
    generatorIssues binding a Java library (generator, class-parse, etc.)
    enhancementProposed change to current functionality
    on Apr 6, 2020
  3. changed the title [-]Generator should not ignore invalid methods and then later invalidate the whole type[/-] [+]Do not invalidate binding an interface if a DIM cannot be bound[/+] on May 21, 2020
  4. jpobst commented on Jun 8, 2020

    @jpobst
    Contributor

    After further research, we do handle default correctly, but not static.

  5. changed the title [-]Do not invalidate binding an interface if a DIM cannot be bound[/-] [+]Do not invalidate binding an interface if a static method cannot be bound[/+] on Jun 8, 2020
  6. brendanzagaeski commented on Jul 14, 2020

    @brendanzagaeski
    Contributor

    Release status update

    A new Preview version of Xamarin.Android has now been published that includes the fix for this item. The fix is not yet included in a Release version. I will update this again when a Release version is available that includes the fix.

    Fix included in Xamarin.Android 11.0.0.3.

    Fix included on Windows in Visual Studio 2019 version 16.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates in Visual Studio Preview.

    Fix included on macOS in Visual Studio 2019 for Mac version 8.7 Preview 4. To try the Preview version that includes the fix, check for the latest updates on the Preview updater channel.

  7. brendanzagaeski commented on Aug 5, 2020

    @brendanzagaeski
    Contributor

    Release status update

    A new Release version of Xamarin.Android has now been published that includes the fix for this item.

    Fix included in Xamarin.Android SDK version 11.0.0.3.

    Fix included on Windows in Visual Studio 2019 version 16.7. To get the new version that includes the fix, check for the latest updates or install the most recent release from https://visualstudio.microsoft.com/downloads/.

    Fix included on macOS in Visual Studio 2019 for Mac version 8.7. To get the new version that includes the fix, check for the latest updates on the Stable updater channel.

  8. locked and limited conversation to collaborators on Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementProposed change to current functionalitygeneratorIssues binding a Java library (generator, class-parse, etc.)

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions