Linphone JAR binding error

GiorgosSgouridis.1853GiorgosSgouridis.1853 USMember
edited August 2016 in Xamarin.Android

i get errors like:
/Users/giorgos/Projects/LiblinphoneBinding/LiblinphoneBinding/obj/Debug/generated/src/Org.Linphone.Core.ILinphoneCoreListener.cs(43,43): Error CS0102: The type Org.Linphone.Core.NotifyReceivedEventArgs' already contains a definition forp0' (CS0102) (LiblinphoneBinding)

there is a partial class with 2 different constructors. HOW TO AJUST the Metadata.xml in Transformations?

public partial class NotifyReceivedEventArgs : global::System.EventArgs {

    public NotifyReceivedEventArgs (global::Org.Linphone.Core.ILinphoneCore p0, global::Org.Linphone.Core.ILinphoneCall p1, global::Org.Linphone.Core.ILinphoneAddress p2, byte[] p3)
    {
        this.p0 = p0;
        this.p1 = p1;
        this.p2 = p2;
        this.p3 = p3;
    }

    global::Org.Linphone.Core.ILinphoneCore p0;
    public global::Org.Linphone.Core.ILinphoneCore P0 {
        get { return p0; }
    }

    global::Org.Linphone.Core.ILinphoneCall p1;
    public global::Org.Linphone.Core.ILinphoneCall P1 {
        get { return p1; }
    }

    global::Org.Linphone.Core.ILinphoneAddress p2;
    public global::Org.Linphone.Core.ILinphoneAddress P2 {
        get { return p2; }
    }

    byte[] p3;
    public byte[] P3 {
        get { return p3; }
    }
}

public partial class NotifyReceivedEventArgs : global::System.EventArgs {

    public NotifyReceivedEventArgs (global::Org.Linphone.Core.ILinphoneCore p0, global::Org.Linphone.Core.ILinphoneEvent p1, string p2, global::Org.Linphone.Core.ILinphoneContent p3)
    {
        this.p0 = p0;
        this.p1 = p1;
        this.p2 = p2;
        this.p3 = p3;
    }

    global::Org.Linphone.Core.ILinphoneCore p0;
    public global::Org.Linphone.Core.ILinphoneCore P0 {
        get { return p0; }
    }

    global::Org.Linphone.Core.ILinphoneEvent p1;
    public global::Org.Linphone.Core.ILinphoneEvent P1 {
        get { return p1; }
    }

    string p2;
    public string P2 {
        get { return p2; }
    }

    global::Org.Linphone.Core.ILinphoneContent p3;
    public global::Org.Linphone.Core.ILinphoneContent P3 {
        get { return p3; }
    }
}
Tagged:

Answers

  • GiorgosSgouridis.1853GiorgosSgouridis.1853 USMember
    edited August 2016

    How can i rename following two methods to different names:

    pragma warning disable 0649
    public EventHandler NotifyReceivedHandler;
    pragma warning restore 0649

        public void NotifyReceived (global::Org.Linphone.Core.ILinphoneCore p0, global::Org.Linphone.Core.ILinphoneCall p1, global::Org.Linphone.Core.ILinphoneAddress p2, byte[] p3)
        {
            var __h = NotifyReceivedHandler;
            if (__h != null)
                __h (sender, new NotifyReceivedEventArgs (p0, p1, p2, p3));
        }
    

    pragma warning disable 0649
    public EventHandler NotifyReceivedHandler;
    pragma warning restore 0649

        public void NotifyReceived (global::Org.Linphone.Core.ILinphoneCore p0, global::Org.Linphone.Core.ILinphoneEvent p1, string p2, global::Org.Linphone.Core.ILinphoneContent p3)
        {
            var __h = NotifyReceivedHandler;
            if (__h != null)
                __h (sender, new NotifyReceivedEventArgs (p0, p1, p2, p3));
        }
    
  • EmilMller.4175EmilMller.4175 NOMember ✭✭

    Hi

    I found that for Linphone you need to add something like this to your Metadata.xml:

      <attr path="/api/package[@name='org.linphone.core']/interface[@name='LinphoneCoreListener']/method[@name='notifyReceived' and parameter[2][@type='org.linphone.core.LinphoneEvent']]" name="managedName">NotifyReceived2</attr>
      <attr path="/api/package[@name='org.linphone.core']/class[@name='LinphoneCoreListenerBase']/method[@name='notifyReceived' and parameter[2][@type='org.linphone.core.LinphoneEvent']]" name="managedName">NotifyReceived2</attr>
      <attr path="/api/package[@name='org.linphone.core.tutorials']/class[@name='TutorialBuddyStatus']/method[@name='notifyReceived' and count(parameter)=4 and parameter[1][@type='org.linphone.core.LinphoneCore'] and parameter[2][@type='org.linphone.core.LinphoneEvent'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='org.linphone.core.LinphoneContent']]" name="managedName">NotifyReceived2</attr>
      <attr path="/api/package[@name='org.linphone.core.tutorials']/class[@name='TutorialChatRoom']/method[@name='notifyReceived' and count(parameter)=4 and parameter[1][@type='org.linphone.core.LinphoneCore'] and parameter[2][@type='org.linphone.core.LinphoneEvent'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='org.linphone.core.LinphoneContent']]" name="managedName">NotifyReceived2</attr>
      <attr path="/api/package[@name='org.linphone.core.tutorials']/class[@name='TutorialHelloWorld']/method[@name='notifyReceived' and count(parameter)=4 and parameter[1][@type='org.linphone.core.LinphoneCore'] and parameter[2][@type='org.linphone.core.LinphoneEvent'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='org.linphone.core.LinphoneContent']]" name="managedName">NotifyReceived2</attr>
      <attr path="/api/package[@name='org.linphone.core.tutorials']/class[@name='TutorialRegistration']/method[@name='notifyReceived' and count(parameter)=4 and parameter[1][@type='org.linphone.core.LinphoneCore'] and parameter[2][@type='org.linphone.core.LinphoneEvent'] and parameter[3][@type='java.lang.String'] and parameter[4][@type='org.linphone.core.LinphoneContent']]" name="managedName">NotifyReceived2</attr>
    
Sign In or Register to comment.