dotnet / java-interop

Java.Interop provides open-source bindings of Java's Java Native Interface (JNI) for use with .NET managed languages such as C#
Other
201 stars 53 forks source link

Do not implement member #1209

Closed ljzj2 closed 7 months ago

jpobst commented 7 months ago

My guess is if you look at the C# IBaseInterface1.AddLisenter it will have a different method signature than BluetoothBle.AddListener, likely the listener parameter was changed to be of type Java.Lang.Object because we don't really support binding Java generics.

If so, you will need to change the BluetoothBle.AddListener parameter to also be Java.Lang.Object using metadata:

https://learn.microsoft.com/en-us/xamarin/android/platform/binding-java-library/customizing-bindings/java-bindings-metadata#managedtype

ljzj2 commented 7 months ago

is there auto fix feature? since there is 396 errors in sdk. it is too hard to fix one by one

jpobst commented 7 months ago

Unfortunately not. Due to differences in Java and C#, there are cases where we do not have enough information to determine the correct thing to do.

If you are only using part of the API, the easiest thing to do is to <remove-node> API that you aren't using that are causing issues.