binSaed / flutter_cached_pdfview

Enhanced PDF view for Flutter.
https://pub.dev/packages/flutter_cached_pdfview
MIT License
118 stars 67 forks source link

Massive app size increase after install this plugin #25

Closed SaliBhdr closed 3 years ago

SaliBhdr commented 3 years ago

Describe the bug Before installing the plugin, my app was 26.3 Mb and After I install the ^0.2.8 version of this plugin the app size increased up to 44.6Mb on android

To Reproduce Steps to reproduce the behavior: Install the plugin and run flutter build apk --release

Expected behavior There is at least an 18Mb gap between two builds. Is the plugin has this much size?

Desktop (please complete the following information):

Smartphone (please complete the following information):

binSaed commented 3 years ago

you can check my last app I use the package with it https://play.google.com/store/apps/details?id=com.Suhaib_Digital_Base&hl=en_US total app size this between 8.5MB to 11MB PLEASE DON'T USE APK => use appbundle

SaliBhdr commented 3 years ago

@AbdOoSaed But what if I don't want to use the app bundle? In fat app build mode, When I build apk without the pdf reader plugin, It was about half the size when the plugin was installed. do you have any idea what could cause this? some wrong config in .gradle or something like that.

binSaed commented 3 years ago

@SaliBhdr we use AndroidPdfViewer for view pdf in android as he says in package doc Android PdfViewer depends on PdfiumAndroid, which is set of native libraries (almost 16 MB) for many architectures.

for this In the fat app, the size will increase by 16 MB

u can read the whole doc in this link

the solution => split ur apk to many architectures or use appbundle as I said

SaliBhdr commented 3 years ago

@AbdOoSaed Ooow. I see!! I happened to be very surprised why this happened. Thanks for the explanation.

binSaed commented 3 years ago

@SaliBhdr have a nice day now I will close the issue If you have any questions please reopen it