-
Notifications
You must be signed in to change notification settings - Fork 47
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
Issue with PaymentIntent as Serializable #386
Comments
@Ekalips can you share which keep rules you had to add in order for this to no longer crash? I can investigate what might be happening here. |
@chr-stripe I've only tried with a simple "keep all Serializables" rule.
But as you can imagine, it's not ideal. I think keeping only PaymentIntent will help and be better, but ideally I wouldn't want to add any more library specific rules into project's proguard config. By the way, we are using |
After stacktrace deobfuscation things became even weirder
is actually
I have no idea how it happens from this
where |
Have you been able to diagnose where that |
@chr-stripe Hey With the debugging I've made, I suspect that it's the Comparator instance in the LinkedHashTreeMap which is set as a value for the Not sure what version of Moshi lib Stripe uses, but our project has Moshi 1.15.0, which overrides yours. Hope it helps in debugging it your side. |
As a result of findings above, also found a better (smaller) proguard config that fixes the issue
Can also probably scope it down even further to just |
We've added two new Proguard rules that will ship with a future release of the Terminal SDK. In the meantime you should be able to add these rules listed below to your own integration until that future release goes live. For keeping
We've also added one rule from Moshi Issue #1663:
This was causing issues in R8 fullMode in certain cases. Hopefully this one will be integrated directly into Moshi some day in the future. |
We have shipped these new Proguard rules as part of SDK 3.2.1, so this should now be fully resolved by the latest SDK version. |
Summary
With the recent Stripe Terminal SDK v3+, PaymentIntent moved from Parcelable to Serializable and it seems like it's causing issues with ProGuard/R8.
It looks like Serializable interface flags get stripped out by ProGuard/R8 causing crash when you try to put a Parcelable that contains PaymentIntent into a Bundle.
It is fixable by adding -keep rules in app's proguard-rules.pro, but it doesn't seem right.
Code to reproduce
Android version
Android 9
Impacted devices (Android devices or readers)
Wise POS E
SDK version
3.1.0
Other information
The text was updated successfully, but these errors were encountered: