flutter_stripe
flutter_stripe copied to clipboard
Reduce package size for Android builds
Is your feature request related to a problem? (please describe)
Too big size of the package for Android build: after adding flutter_stripe
to a new project, it increases size of a resulting apk file by about 7.9MB for the release build (flutter build apk
).
Describe the solution you'd like Check for the possibilities to shrink package size for Android builds.
Hi there,
We already use the minimum amount of dependencies to make it work, which is the stripe android package. I suggest to have a look if proguard can help you and consult on the stripe android repository for further questions.
@jonasbark, thank you!
For documentation purposes, I'll leave the following link to the stripe-android repo. Seems that size can be reduced using proguard settings.
https://github.com/stripe/stripe-android/issues/4483
@jonasbark, I would also consider adding this to the documentation, since it can be critical for some users. What do you think?
yes that is very useful I will reopen it and add it to the docs project
The codebase is already shrunk by default using R8 see docs.
While the comment above suggest the app will be reduced if not using Payment Sheet, in this package the bindings make use of these apis. So even if Payment Sheet is not used in the dart side, it is used in the native side, and therefore will not be removed during minification.
We could separate the PaymentSheet into a separate package, but right now is not worth the development effort to do it and mantain it. Plus the inconvenience for all developers to migrate from a breaking change like that