Skip to content

'NoSuchMethodError' calling static interface method on pre-API-24 #6784

@vas1l3nk

Description

@vas1l3nk

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.)

Affected platform version

VSMac 8.10.19(build 2)

Description

The problem occurs when I try to call an initialisation native method from my binding library (.aar). I know that the method exist in my Android Binding Library. Deleting folders bin and obj and rebuilding the project does not help. I also watched the file api.xml this method is there, and and I can refer to it. Removing or adding a method to Metadata.xml also doesn't help.
I also decompiled the .dll file and saw this method there.

method: Start(global::Android.Content.Context context, global::package.name.Configuration configuration)
The error I'm getting

Java.Lang.NoSuchMethodError
no static method "Lpackage/name/SDK;.start(Landroid/content/Context;Lpackage/name/Configuration;)V"

Steps to Reproduce

Create Android Binding library via .arr, which needs to be initialized in MyApplication.cs
Add reference from the Xamarin.Android project to Binding library.
Start the app

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

Area: BindingsIssues in Java Library Binding projects.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions