Skip to content

Can't get SourceTypeModel from Source (Java.Lang.NoSuchMethodError: no non-static method "Lcom/stripe/android/model/Source;.getSourceTypeModel()Lcom/stripe/android/model/StripeJsonModel;) #2

Description

@kyhosy

Hi NAXAM.
I'm implementing stride sdk for payment on xamarin android, so i'm using package Naxam.Stripe.Droid 5.1.1.
And in the package, i can't get value of SourceTypeModel from Source.
SourceCardData sourceCardData = (SourceCardData)s.SourceTypeModel;

It always throw exception: {Java.Lang.NoSuchMethodError: no non-static method "Lcom/stripe/android/model/Source;.getSourceTypeModel()Lcom/stripe/android/model/StripeJsonModel;" ...... }

When i compare between native code of Stripe sdk and the generated C# file. I found that return type of method "getSourceTypeModel" is not correct. It should be "StripeSourceTypeModel" instead of "StripeJsonModel".

So I have solution for the issue: we try to update "return type" on RegisterAttribute.
[Register ("getSourceTypeModel", "()Lcom/stripe/android/model/StripeSourceTypeModel;", "GetGetSourceTypeModelHandler")]
By add some code on file metadata.xml:
<remove-node path="/api/package[@name='com.stripe.android.model']/class[@name='Source']/method[@name='getSourceTypeModel' and count(parameter)=0]" /> <add-node path="/api/package[@name='com.stripe.android.model']/class[@name='Source']"> <method name="getSourceTypeModel" return="com.stripe.android.model.StripeSourceTypeModel" abstract="false" native="false" synchronized="false" static="false" final="true" deprecated="not deprecated" visibility="public"> </method> </add-node>

I had tested and it worked. Hope it's useful for you!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions