'How to reduce the size of an application built with Jetpack Compose?
I created an empty application on Jetpack Compose, enabled the minifyEnabled = true flag in it and compiled the release apk. Its size turned out to be 1.7 mb, which, in my opinion, is a lot for an empty application.
Can I somehow reduce the size of the application?
implementation "androidx.compose.ui:ui:$compose_version"
implementation 'androidx.compose.material:material:1.0.0-alpha10'
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha06'
Solution 1:[1]
As highlighted in https://twitter.com/vinaygaba/status/1488561816179331074, Compose apps should use:
debugImplementation "androidx.compose.ui:ui-tooling:{{ composeVersion }}"
implementation "androidx.compose.ui:ui-tooling-preview:{{ composeVersion }}"
Instead of:
implementation "androidx.compose.ui:ui-tooling:{{ composeVersion }}"
By doing so, you are going to save a few hundred kbs from your app size.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lbarqueira |
