Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Aug 12, 2023 · 7 comments

Comments

@egonbeermat
Copy link

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
Copy link
Author

egonbeermat commented Aug 13, 2023

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
Copy link

gevoid commented Feb 19, 2024

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
Copy link
Author

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 marcos930807 pinned this issue May 7, 2024
@marcos930807
Copy link
Owner

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
Copy link
Owner

marcos930807 commented May 7, 2024

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
Copy link
Author

egonbeermat commented May 7, 2024

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
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants