Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kyhosy opened this issue Nov 15, 2017 · 1 comment

Comments

@kyhosy
Copy link

kyhosy commented Nov 15, 2017

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!

@tuyen-vuduc
Copy link
Contributor

@kyhosy do you try the latest one? Is it still required your fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants