marcos930807 / awesomeDialogs

A new Flutter package project for simple a awesome dialogs
Other
339 stars 110 forks source link

Upgrade of awesome_dialog from 3.0.2 to 3.1.0 causes significant increase in Android release aab size and apk download size #135

Open egonbeermat opened 1 year ago

egonbeermat commented 1 year ago

Running flutter build appbundle --release for my app with awesome_dialog 3.0.2 produces an aab of 37Mb

Just changing awesome_dialog in pubspec.yaml to 3.1.0 and running the build again produces an aab of 76.7Mb

Google Play Console gives the warning "This artifact significantly increases the size of APK(s) downloaded by users. Larger apps see lower install and update success rates and take up device storage on user's devices" and it estimates the size for new installs as 26.7 MB, an increase of 9.97 MB from my previous release (the only difference between releases is the change of awesome_dialog from 3.0.2 to 3.1.0), which is not acceptable to me.

Checking the appbundle in the App bunder explorer in Google Play Console, it seems a new ABI for X86 is added to the bundle. The change to 3.1.0 causes the following dependency changes/updates:

> awesome_dialog 3.1.0 (was 3.0.2)
> rive 0.11.4 (was 0.9.1) (0.11.14 available)
+ rive_common 0.1.0 (0.2.6 available)

So I suspect it is something to do with rive_common. Is anyone else experiencing this, and how can I prevent this behavior? For now, I will stay with awesome_dialog 3.0.2.

egonbeermat commented 1 year ago

Update

I thought I had looked at the rive issue log, but I revisted and found a similar problem with this (partial) solution: specifying a specific ndk version helps:

android {
    ...
    ndkVersion '25.1.8937393'
}

This produced an aab of 43.3Mb, far less than 76.7Mb without explicit ndk version, and closer to the original 37Mb.

I also added the following:

packagingOptions {
      exclude 'lib/**/librive_text.so'
}

which excludes the rive_text runtime, and produces an aab of 37.3Mb. I need to test that this doesn't break awesome_dialogs or my app, but it helps explain what is responsible for the increase in aab size.

gevoid commented 6 months ago

i am using this command for build apk "flutter build apk --release"

before doing what you said app size is 200mb, after doing it is 60mb

thanks

egonbeermat commented 5 months ago

Same problem here. But exclude 'lib/**/librive_text.so' doesn't work

Did you use the NDK version specified above? That had the largest impact on reducing the size.

marcos930807 commented 3 months ago

Update

I thought I had looked at the rive issue log, but I revisted and found a similar problem with this (partial) solution: specifying a specific ndk version helps:

android {
    ...
    ndkVersion '25.1.8937393'
}

This produced an aab of 43.3Mb, far less than 76.7Mb without explicit ndk version, and closer to the original 37Mb.

I also added the following:

packagingOptions {
      exclude 'lib/**/librive_text.so'
}

which excludes the rive_text runtime, and produces an aab of 37.3Mb. I need to test that this doesn't break awesome_dialogs or my app, but it helps explain what is responsible for the increase in aab size.

Thanks for this. in my case change mi AAB from 117.3 to 68.3

marcos930807 commented 3 months ago

For me exclude 'lib/**/librive_text.so' broke the header animation. Sadly. But using this exact same version helps android { ... ndkVersion '25.1.8937393' } before a was using a more modern version of NDK

egonbeermat commented 3 months ago

For me exclude 'lib/**/librive_text.so' broke the header animation

I noticed you updated the rive dependency from 0.12.4 to 0.13.2, which is the 'cause'. Header animations work fine with these build changes and rive 0.12.4, but when I switched to 0.13.2, they disappeared.

marcos930807 commented 3 months ago

For me exclude 'lib/**/librive_text.so' broke the header animation

I noticed you updated the rive dependency from 0.12.4 to 0.13.2, which is the 'cause'. Header animations work fine with these build changes and rive 0.12.4, but when I switched to 0.13.2, they disappeared.

Thanks for the info. For me Right now using the latest version and fixing the NDK to this version ndkVersion '25.1.8937393' has result in a decent APP Size.