Xamarin.forms上的Java绑定库中未找到覆盖方法

发布于 2025-02-06 03:35:54 字数 1075 浏览 3 评论 0原文

我正在为Xamarin.Forms创建一个Java绑定库,以包装.jar库。

编译时我遇到了几个错误。

我已经解决了使用“ transforms”部分中具有相同签名的多种方法给出的问题。

尽管如此,编译器仍在不断提出适合此方法的替代:

[Register ("compareTo", "(Ljava/lang/Object;)I", "GetCompareTo_Ljava_lang_Object_Handler")]
public override unsafe int CompareTo (global::Java.Lang.Object o)
{
    const string __id = "compareTo.(Ljava/lang/Object;)I";
    try {
        JniArgumentValue* __args = stackalloc JniArgumentValue [1];
        __args [0] = new JniArgumentValue ((o == null) ? IntPtr.Zero : ((global::Java.Lang.Object) o).Handle);
        var __rm = _members.InstanceMethods.InvokeAbstractInt32Method (__id, this, __args);
        return __rm;
    } finally {
        global::System.GC.KeepAlive (o);
    }
}

此外,UP方法的所有类别没有元数据参考,并且该方法本身没有。这使得甚至很难尝试在“ metadata.xml”中删除节点。

为了给您一个线索,可以在以下类中找到“ compareTo”方法:

Java.Nio.Charset.Charset

基本上是生成器继承的类,以便在

public abstract partial class CustomCharset

我尝试忽略整个类之前创建一个,在应用程序上产生意外的后果,我是我即将发展,我想知道是否有人经历过类似的事情。如何解决?

I'm creating a Java Binding Library for Xamarin.Forms in order to wrap a .jar library.

I got a couple of errors while compiling.

I already solved an issue given by multiple methods having the same signature using "Metadata.xml" in "Transforms" section.

Still, the compiler keeps on bringing out that an appropriate override for this method can't be found:

[Register ("compareTo", "(Ljava/lang/Object;)I", "GetCompareTo_Ljava_lang_Object_Handler")]
public override unsafe int CompareTo (global::Java.Lang.Object o)
{
    const string __id = "compareTo.(Ljava/lang/Object;)I";
    try {
        JniArgumentValue* __args = stackalloc JniArgumentValue [1];
        __args [0] = new JniArgumentValue ((o == null) ? IntPtr.Zero : ((global::Java.Lang.Object) o).Handle);
        var __rm = _members.InstanceMethods.InvokeAbstractInt32Method (__id, this, __args);
        return __rm;
    } finally {
        global::System.GC.KeepAlive (o);
    }
}

Additionally, the owning class of the up method has NO METADATA REFERENCE, as well as the method itself doesn't have one. This makes it difficult even to try removing the node in "Metadata.xml".

To give you a clue, the method "CompareTo" can be found in the following class:

Java.Nio.Charset.Charset

that basically is the class the generator inherits in order to create a

public abstract partial class CustomCharset

Before I try to ignore the entire class, with unexpected consequences on the app I'm about to develop, I would like to know if anyone has ever gone through something similar please. How to solve?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文