hms-flutter-plugin icon indicating copy to clipboard operation
hms-flutter-plugin copied to clipboard

Library size is too big (350+ MB)

Open Ayatafoy opened this issue 2 years ago • 9 comments

Description After adding library into dependencies, app size increased from 68 to 424 MB.

How we can reduce app size?

Ayatafoy avatar Aug 30 '22 08:08 Ayatafoy

Can I confirm what Kit plugins you have integrated? And how do you configure it?

Xuejiao-Shi avatar Aug 30 '22 08:08 Xuejiao-Shi

We use https://pub.dev/packages/huawei_ml_image. I added this plugin to dependencies.

Anpoda avatar Aug 30 '22 09:08 Anpoda

More specifically we use: huawei_ml_image: ^3.2.0+301 version. And the huawei library size is not 350 but around 100MB. 250 it's google ML Kit which is also too big.

Ayatafoy avatar Aug 30 '22 11:08 Ayatafoy

ML has multiple plugins, you can select the ML plug-ins based on the actual scenario. For details, you could refer to this docs.

Xuejiao-Shi avatar Aug 31 '22 03:08 Xuejiao-Shi

As I mentioned above, we use the following pluginL: huawei_ml_image. For setting up the plugin we used the documentation you provided: docs. Currently huawei_ml_image package reserves 100 mb storage. Is it possible to reduce it? 100 MB it's too big size, so we can't publish an app because of it.

Ayatafoy avatar Aug 31 '22 17:08 Ayatafoy

In this case, you are advised to tailor dependencies in huawei_ml_image-3.2.0+301\android\build.gradle by referring to the API. After the tailoring is complete, modify the corresponding code.

Xuejiao-Shi avatar Sep 01 '22 03:09 Xuejiao-Shi

Could you please clarify what do you mean? In build/huawei_ml_image I don't see android folder image

Ayatafoy avatar Sep 02 '22 15:09 Ayatafoy

huawei_ml_image-*.*\android\build.gradle

In local package repositories, like following: image

Xuejiao-Shi avatar Sep 05 '22 07:09 Xuejiao-Shi

how to reduce if I just use huawei_location?

guvanch07 avatar Jan 22 '23 00:01 guvanch07