Forum Xamarin.Android

Struggling with Java binding (Using Xamarin Android)

Hello please help,

I removed some namespaces in Metadata.xml while binding a java library like:

<remove-node path="/api/package[@name='com.payu.india.Tasks']/class[@name='VerifyPaymentTask']" />

After that java library successfully bind with my xamarin's java binding project, then i referenced that java binding project's dll with my demo project then i got error like:

Error 1: 'Com.Payu.India.Tasks.VerifyPaymentTask' does not implement inherited abstract member 'Android.OS.AsyncTask.DoInBackground(params Java.Lang.Object[])' PayU Integration\PayUSdkLib\PayUSdkLib\obj\Debug\generated\src\Com.Payu.India.Tasks.VerifyPaymentTask.cs 9 23 PayUSdkLib

Can anyone please help me that how can i solve this type of error....

Thanks and Regards..


  • PhilippeTPhilippeT FRMember ✭✭

    Unfortunately, Android Bindings are under-documented ;(
    it's a shame cause they could really be powerfull...
    maybe, you can try with name="managedType">Java.Lang.Object on the method DoInBackground
    (source : Ligne 70-80 )

  • Ranjeet_SinghRanjeet_Singh INMember ✭✭

    Thanks @PhilippeTroller for your response, i already find solution for my question after lots of research.....

  • PhilippeTPhilippeT FRMember ✭✭

    Nice @Ranjeet_Singh, could you please share your solution ?
    I think it could help me for future bindings :wink:
    Thank you in advance !

  • Ranjeet_SinghRanjeet_Singh INMember ✭✭
    edited November 2015

    Sure @PhilippeTroller ,

    We have to note 3 main points while binding java libraries.

    1) Build Action of .jar file should be "EmbeddedJar".

    2) Remove namespace in metadata.xml like:
    <remove-node path="/api/package[@name='com.payu.india.Tasks']/class[@name='DeleteCardTask']" />
    if we have error like:
    **Error 1 'Com.Payu.India.Tasks.DeleteCardTask' does not implement inherited abstract member 'Android.OS.AsyncTask.DoInBackground(params Java.Lang.Object[])' E:\FleetNo1\com.fleetno1\PayU Integration\PayUSdkLib\PayUSdkLib\obj\Debug\generated\src\Com.Payu.India.Tasks.DeleteCardTask.cs 9 23 PayUSdkLib

    3) If we have any accessibility errors in any class the we have to Change these classes to visibility public like:

    and so on, now try to build your java binding library so that you got your project's dll.

    If you still have any error, you can ask me anytime, i like to mesh with errors and excited to remove them...

    For more details, have a look on tutorial mentioned below:


  • KolaMounikaKolaMounika USMember ✭✭✭



    I'm facing similar issues :(

    I tried your solution but no luck

    <remove-node path="/api/package[@name='com.payu.india.Tasks']/class[@name='DeleteCardTask']" />

    Here are my errors

Sign In or Register to comment.