shuftipro / Android-SDK

Shufti Pro Mobile SDK for Android
4 stars 12 forks source link

Error CS0542 'FaceVerification': member names cannot be the same as their enclosing type #2

Closed Edgaras91 closed 5 years ago

Edgaras91 commented 5 years ago

Hi,

I am importing this SDK into Xamarin Forms solution. When compiling the class: public partial class FaceVerification : global::Java.Lang.Object

I get above error at:

public virtual unsafe bool FaceVerification {
            // Metadata.xml XPath method reference: path="/api/package[@name='com.shutipro.sdk.models']/class[@name='FaceVerification']/method[@name='isFaceVerification' and count(parameter)=0]"
            [Register ("isFaceVerification", "()Z", "GetIsFaceVerificationHandler")]
            get {
                if (id_isFaceVerification == IntPtr.Zero)
                    id_isFaceVerification = JNIEnv.GetMethodID (class_ref, "isFaceVerification", "()Z");
                try {

                    if (((object) this).GetType () == ThresholdType)
                        return JNIEnv.CallBooleanMethod (((global::Java.Lang.Object) this).Handle, id_isFaceVerification);
                    else
                        return JNIEnv.CallNonvirtualBooleanMethod (((global::Java.Lang.Object) this).Handle, ThresholdClass, JNIEnv.GetMethodID (ThresholdClass, "isFaceVerification", "()Z"));
                } finally {
                }
            }

image

I believe when converting this into .NET library, it is not allowed to have a property name same as the class name.

For this reason, I'm not able to try out your product in our solution.

Edgaras91 commented 5 years ago

A bit more info: I was following this step by step to add the SDK: https://docs.microsoft.com/en-gb/xamarin/android/platform/binding-java-library/binding-an-aar

I believe the key part to this error was this step:

Set the Build Action for textanalyzer.aar to LibraryProjectZip. In Visual Studio for Mac, right-click textanalyzer.aar to set the Build Action. In Visual Studio, the Build Action can be set in the Properties pane):

Edgaras91 commented 4 years ago

Tried again, still the same problem. I can not import shuftipro-sdk.aar as an android binding project for Xamarin Forms, thus not able to use this SDK on Xamarin Forms.