can use use android binding?
I am using android binding . I want to get dll from '.aar' which is 'zxing-android-embeded.aar'
in Debug mode I can get dll but there is nothing in dll in Release mode there is two error :
Size does not implement member 'IComparable.CompareTo(Object)'
but I can see that it have implemented it.
[Register ("compareTo", "(Lcom/journeyapps/barcodescanner/Size;)I", "GetCompareTo_Lcom_journeyapps_barcodescanner_Size_Handler")]
public virtual unsafe int CompareTo (global::Com.Journeyapps.Barcodescanner.Size other)
{
const string __id = "compareTo.(Lcom/journeyapps/barcodescanner/Size;)I";
try {
JniArgumentValue* __args = stackalloc JniArgumentValue [1];
__args [0] = new JniArgumentValue ((other == null) ? IntPtr.Zero : ((global::Java.Lang.Object) other).Handle);
var __rm = _members.InstanceMethods.InvokeVirtualInt32Method (__id, this, __args);
return __rm;
} finally {
global::System.GC.KeepAlive (other);
}
}
why?
It feels like there is a Java method named CompareTo that conflicts with what .NET expects.
We have some general troubleshooting docs for bindings at:
- https://github.com/dotnet/java-interop/wiki/Troubleshooting-Android-Bindings-Issues
- https://github.com/dotnet/android-libraries/blob/main/docs/development-tips.md#troubleshooting
thank you for your reply but I think it is not that you said.
since there is another same error:
`protected virtual unsafe global::Com.Journeyapps.Barcodescanner.Camera.CameraThread? CameraThread {
// Metadata.xml XPath method reference: path="/api/package[@name='com.journeyapps.barcodescanner.camera']/class[@name='CameraInstance']/method[@name='getCameraThread' and count(parameter)=0]"
[Register ("getCameraThread", "()Lcom/journeyapps/barcodescanner/camera/CameraThread;", "GetGetCameraThreadHandler")]
get {
const string __id = "getCameraThread.()Lcom/journeyapps/barcodescanner/camera/CameraThread;";
try {
var __rm = _members.InstanceMethods.InvokeVirtualObjectMethod (__id, this, null);
return global::Java.Lang.Object.GetObject<global::Com.Journeyapps.Barcodescanner.Camera.CameraThread> (__rm.Handle, JniHandleOwnership.TransferLocalRef);
} finally {
}
}
}`
and when I open it there is:
CS1503 parameter 1 can not convert from “Com.Journeyapps.Barcodescanner.Camera.CameraThread?” To “Android.Runtime.IJavaObject?”
there is no CameraThread in .net right? so there is no conflict.
and I have rename the CompareTo it is not work.
I would review the docs above for related cases.
From your example, I don't see what line CS1503 is referring to.
for CS1503 is this line:
static IntPtr n_GetCameraThread (IntPtr jnienv, IntPtr native__this) { var __this = global::Java.Lang.Object.GetObject<global::Com.Journeyapps.Barcodescanner.Camera.CameraInstance> (jnienv, native__this, JniHandleOwnership.DoNotTransfer)!; return JNIEnv.ToLocalJniHandle (__this.CameraThread); }
what do you suggest me to do now?
when I want to remove the node of Size there will be error too. Size does not implement member IComparable.CompareTo(Object)
and there will be another new error