How to make a JAR-wrapper?

Hello!

I have a problem when you create a wrapper for JAR-library.

JAR-Library - Yandex.Money.SDK. It is in the NuGet-repository, but only for WindowsPhone, but I need for Android.

I took the official repository SDK ( https://github.com/yandex-money/yandex-money-sdk-java ), I compile it into a JAR-file and in the instructions, put in Binding Project in Xamarin. But when compiling I get some nasty errors that I can not fix.

In Java source code, for example, IPaymentProcess extends Process. But neither the Process, none IProcess wrapper does not see.

What should I do? I would appreciate any assistance with respect, Alex.

Sources of Yandex.Money.SDK — https://github.com/yandex-money/yandex-money-sdk-java
Compiled in JAR Yandex.Money.SDK — https://yadi.sk/d/eKweqTfdmD7sk

Example of error:

All errors at building:

Answers

  • la.tanblala.tanbla USMember ✭✭

    This error is often caused because that Java class (or method in other cases) is not marked public. To fix, add this to your MetaData.xml file:
    <attr path="/api/package[@name='com.yandex.money.api.processes']/interface[@name='IPaymentProcess']" name="visibility">public</attr>

  • AleVerDesAleVerDes RUMember ✭✭

    @la.tanbla said:
    This error is often caused because that Java class (or method in other cases) is not marked public. To fix, add this to your MetaData.xml file:
    <attr path="/api/package[@name='com.yandex.money.api.processes']/interface[@name='IPaymentProcess']" name="visibility">public</attr>

    Thank you for your answer, la.tanbla!

    No, unfortunately it does not help.

    There are some solutions?

  • AleVerDesAleVerDes RUMember ✭✭

    Hi! I corrected previous mistakes, but I have new errors

  • la.tanblala.tanbla USMember ✭✭
    edited December 2015

    I've attached my metadata.xml file. It builds for me but I noticed that there are a couple of warnings about not being able to find the top ancestor for classes like Operation, ParametersBuffer, ShowcaseContext etc ... I hope that you won't need any of those classes or their child classes/enums/interfaces because I do not know how to get the generator to create classes for them. Perhaps some one else will be able to shed some light on that.

    EDIT:
    For some reason I can't attach a file. Here is the code to put in MetaData.xml:

    <metadata>
    
      <attr path="/api/package[@name='com.yandex.money.api.processes']/interface[@name='Process']" name="visibility">public</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components']/class[@name='TextBlock.WithLink']/method[@name='getToStringBuilder' and count(parameter)=0]" name="visibility">protected</attr>
    
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='AuxToken']/field[@name='auxToken']" name="name">AuxTok</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='InstanceId']/field[@name='instanceId']" name="name">InstanceID</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods.params']/class[@name='PaymentParams']/field[@name='paymentParams']" name="name">PayParams</attr>
    
      <remove-node path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Control.Builder']/method[@name='create' and count(parameter)=0]" />
      <remove-node path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='ParameterControl.Builder']/method[@name='create' and count(parameter)=0]" />
    
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='BaseProcessPayment.Status']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='BaseRequestPayment.Status']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='OperationHistory.FilterType']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='RequestPayment.TestResult']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='AccountStatus']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='AccountType']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='AllowedMoneySource']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='Card.Type']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='Error']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='PayeeIdentifierType']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase']/class[@name='AmountType']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components']/class[@name='Component.Type']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.containers']/class[@name='Group.Layout']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components']/class[@name='Parameter.AutoFill']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Select.Style']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Text.Keyboard']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase']/class[@name='ShowcaseReference.Format']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='SimpleStatus']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='YandexMoneyCard.State']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
    
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='ProcessExternalPayment.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Methods.BaseProcessPayment</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='ProcessPayment.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Methods.BaseProcessPayment</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='RequestExternalPayment.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Methods.BaseRequestPayment</attr>
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='RequestPayment.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Methods.BaseRequestPayment</attr>
    
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='Card.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.MoneySource</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model']/class[@name='Wallet.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.MoneySource</attr>
    
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.containers']/class[@name='Group.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.containers']/class[@name='Paragraph.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Checkbox.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Number.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Select.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='Submit.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
      <attr path="/api/package[@name='com.yandex.money.api.model.showcase.components.uicontrols']/class[@name='TextArea.Builder']/method[@name='create' and count(parameter)=0]" name="return">Com.Yandex.Money.Api.Model.Showcase.Components.Component</attr>
    
      <attr path="/api/package[@name='com.yandex.money.api.methods']/class[@name='ProcessPayment.TestResult']/method[@name='getValues' and count(parameter)=0]" name="return">Java.Lang.Object[]</attr>
    </metadata>
    
Sign In or Register to comment.