binSaed / flutter_cached_pdfview

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

Issue with apk size #20

Closed amanv8060 closed 3 years ago

amanv8060 commented 3 years ago

Using this package adds up approximately 15 mb to my apk . Is there some optimization

binSaed commented 3 years ago

15MB is so big I have more than an app in google play using my package and app size 9MB approx

so I will give u some advice

- size in debug mode is different from release mode

- don't upload apk to google play it is recommended to use appbundle to let google split it to different CPU architecture

- and don't forget to add proguard-rules.pro

https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/8ca667d27234cde23a8ebef0e3220ec90a98dba2/example/android/app/proguard-rules.pro#L1

- and build.gradle from line 49 to 69

https://github.com/AbdOoSaed/flutter_cached_pdfview/blob/8ca667d27234cde23a8ebef0e3220ec90a98dba2/example/android/app/build.gradle#L49

amanv8060 commented 3 years ago

i have attahced size analysis for both ,this is of a specific apk architecture , not fat apk

size jsons.zip

binSaed commented 3 years ago

@amanv8060

the diff is only 3MB when u use bundle

DIF

amanv8060 commented 3 years ago

No difference is 18 mb , I am surprised too , that why adding this is causing issue I tried atleast 7-8 times before and after filing the issue

binSaed commented 3 years ago

18MB for all architectures every device only use one architecture google play will split ur bundle

amanv8060 commented 3 years ago

Yes , i am aware of that , notice that , these are the analysis for specific cpu structure not of fat apk