In Flutter, when I use third-party packages, the app works fine, but when I build my app, the app size comes in at more than 100MB to 150MB. example: I am using the Agora package for video calls. I just added the package after I tried to build my app size, like 138 MB. What is the solution for this? I want to reduce the app size, and at the same time, I want to use the package.
2
There are multiple way to reduce app size.
After generating APK click on analysis and look for the size which is taken.
-
Mostly unused Images or High quality asset will took the place for that try to convert asset to
.webp
format. -
If u use some library that will include it for all architecture that will increase app size.
Solution: In development phase enable following.
In your build.gradle inside defaultConfig add this:
ndk {
abiFilters "armeabi", "x86", "armeabi-v7a"
}
You can add "x86" if u want to run on emulator
When in production playstore use aab
.