-
Notifications
You must be signed in to change notification settings - Fork 662
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
Too many methods in the SDK prevent from being able to build app #1559
Comments
@ata-n thanks for filing. There like isn't anything we can do in the short-term to fix this, but I'd like to put this on our backlog. Can you help me understand |
Thanks for the response @mshafrir-stripe
Again I like to emphasize that after examination of the dex file, it is believed that the culprit is BouncyCastle which is a dependency of stripe-3ds2. |
Keep only the BouncyCastle provider classes Verified by running 3DS2 on a real card Fixes #1559
Keep only the BouncyCastle provider classes Verified by running 3DS2 on a real card Fixes #1559
Thank you @mshafrir-stripe for the fix! I see there have been changes to the rules for Material as well. Wonderful! May I ask that these changes be applied to the 10.x version as well? :) We use the Stripe SDK in our own SDK as a dependency and we have a strict no AndroidX policy for maximum compatibility. |
@ata-n yes, I can do a 10.x release next week with the Proguard changes |
@mshafrir There seems to be many packages other than jcajce and jce: Is there any way to reduce this count to the 3800 above? |
@Alvtag you need to specify |
@mshafrir Thanks, I updated minify to true, cleared caches and restart, and rebuilt the APK but still seeing the high number. Are there any Proguard files that I might have to update? |
What version of Gradle and AGP are you using? |
I have |
@Alvtag try upgrading to the latest version of Gradle and AGP. The SDK's Proguard rules is referenced via |
It works! in addition to updating Gradle and AGP, I found that I only had minifyEnabled on release flavor. When I either built under release, or added minifyEnabled to debug, I see the 3800 method count kudos for the help @mshafrir-stripe |
Summary
As we know Android allows 65k methods in a single dex file. As of version 9.3.0 (with 3Ds2) the Stripe SDK has a dependency on bouncycastle for encryption (defacto Java encryption library). The issue is this library alone introduces 22k methods. I have noticed the proguard rules also contain a keep line for anything in bouncycastle which prevent them from being and or shrunk.
Code to reproduce
Android version
API 28
Impacted devices
All devices
Installation method
Gradle
SDK version
9.3.0 +
Other information
Here is a sample build.gradle that produces the error:
Unfortunately multidexing is not an option since our product is an SDK itself and we would like to introduce minimal number of methods to play nice with other existing apps. Multidexing also has its own set of issues and complexities and as Google recommends it should be avoided.
It just seems to me that Stripe is bringing in an unreasonable amount of methods which will ultimately force all consumers down a multidex approach which may or may not work for everyone.
The text was updated successfully, but these errors were encountered: