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.

Invalid [Register] for nested default interface method invokers #661

Closed

Description

@VladislavAntonyuk

Steps to Reproduce

  1. Create default Xamarin Forms app
  2. Set TargetFramework to 10.0.0.99 and sdk to 30
  3. run app

System.TypeLoadException: 'Could not load type 'Android.App.Application.IActivityLifecycleCallbacks' from assembly 'Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.'

Activity

  1. jpobst commented on Jun 11, 2020

    @jpobst
    Contributor

    Thanks for the report! We were just in the middle of trying to track this down. Turns out it's a generator bug, so moving this to Java.Interop repo.

  2. transferred this issue fromdotnet/androidon Jun 11, 2020
  3. self-assigned this
    on Jun 11, 2020
  4. added
    bugComponent does not function as intended
    generatorIssues binding a Java library (generator, class-parse, etc.)
    on Jun 11, 2020
  5. jpobst commented on Jun 11, 2020

    @jpobst
    Contributor

    The issue is that when we [Register] the invoker for a default method in a nested class, we are using . to denote a nested class, when it should be a /.

    For example, in:

    [Register ("onActivityPostCreated", "(Landroid/app/Activity;Landroid/os/Bundle;)V", "GetOnActivityPostCreated_Landroid_app_Activity_Landroid_os_Bundle_Handler:Android.App.Application.IActivityLifecycleCallbacks, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince = 29)]
    

    Android.App.Application.IActivityLifecycleCallbacks should be Android.App.Application/IActivityLifecycleCallbacks.

    This is causing the nested type to not be found.

  6. changed the title [-]Android SDK 30 runtime issue[/-] [+]Invalid [Register] for nested default interface method invokers[/+] on Jun 11, 2020
  7. jpobst commented on Jun 11, 2020

    @jpobst
    Contributor

    The fix for this should be in VS2019 16.7 Preview 4.

  8. 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.

  9. 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 issue.

    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.

  10. 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

Labels

bugComponent does not function as intendedgeneratorIssues binding a Java library (generator, class-parse, etc.)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions