2017-04-12 104 views
1

我试图在我的绑定库项目中绑定DJI-SDK.Jar文件。当我建立我的项目,它向我展示了这些错误。Xamarin中的Jar文件绑定错误

帕拉姆错误时生成项目

当我删除了帕拉姆关键字其他错误显示

Error CS0535 'ResolutionAndFrameRate' does not implement interface member 'IComparable.CompareTo(Object)'

Error CS0535 'FlyforbidUtils.DataComparator' does not implement interface member 'IComparator.Compare(Object, Object)'

Error CS0111 Type 'ServiceManager' already defines a member called 'Destroy' with the same parameter types

Error CS0111 Type 'UsbHostServiceRC' already defines a member called 'Destroy' with the same parameter types

Error CS0111 Type 'BluetoothLeService' already defines a member called 'Destroy' with the same parameter type

Error CS0121 The call is ambiguous between the following methods or properties: 'BluetoothLeService.Destroy()' and 'BluetoothLeService.Destroy()'

请帮我解决这些问题。 在此先感谢。

+0

不要使用错误的图像,添加错误文本直接到您的问题 – SushiHangover

+0

谢谢@SushiHangover我更新了我的问题与错误文本 – user3367428

回答

1

IComparable的Java泛型实现存在一个问题。

您可以创建一个附加/ your_class_name.cs包含部分your_class类的CompareTo明确的方法实现,如:

using System; 
using System.Collections.Generic; 
using Android.Runtime; 

namespace Com.Journeyapps.Barcodescanner 
{ 
    public partial class Size 
    { 
     int Java.Lang.IComparable.CompareTo(Java.Lang.Object obj) 
     { 
      return CompareTo((Com.Journeyapps.Barcodescanner.Size)obj); 
     } 
    } 
} 

看到这个答案在这里:https://forums.xamarin.com/discussion/1950/binding-jar-file-with-class-that-implements-java-lang-icomparable