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

Remove material-icons-extended as a dependency of compose-material-dialogs:core and others #153

Closed
yankeppey opened this issue May 31, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@yankeppey
Copy link

Describe the bug
After I added compose-material-dialogs:core to my project, 20 mb was added to the final apk size. It seems it brought the whole material-icons-extended library with it:

 +--- io.github.vanpra.compose-material-dialogs:core:0.7.0
|    |    |    +--- androidx.core:core-ktx:1.7.0 (*)
|    |    |    +--- androidx.compose.ui:ui:1.1.1 (*)
|    |    |    +--- androidx.compose.material:material:1.1.1 (*)
|    |    |    +--- androidx.compose.material:material-icons-extended:1.1.1
|    |    |    |    +--- androidx.compose.material:material-icons-core:1.1.1 (*)
|    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10
|    |    |    |    \--- androidx.compose.runtime:runtime:1.1.1 (*)
|    |    |    +--- androidx.compose.animation:animation:1.1.1 (*)
|    |    |    +--- androidx.compose.foundation:foundation-layout:1.1.1 (*)
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10 (*)

Expected behaviour
I don't expect a library showing dialogs to bring any icons with it, and for sure it should not depend on the extended set of the material icons.

Suggested solution

The material icons are used in several places, such as: Demos, Tests, and in a couple of places in DatePicker module.
Let's leave the dependency of material-icons-extended only for Demos and Tests, and for DatePicker, let's copy-paste the used icons, as suggested in the docs:

Due to the very large size of this library, make sure to use R8/Proguard to strip unused icons if you are including this library as a direct dependency. Alternatively you can make a local copy (by copy and pasting) the icon(s) you wish to keep, or using Android Studio's 'Import vector asset' feature.

@yankeppey yankeppey added the bug Something isn't working label May 31, 2022
@yankeppey yankeppey changed the title Remove material-icons-extended as a dependency of compose-material-dialogs:core Remove material-icons-extended as a dependency of compose-material-dialogs:core and others May 31, 2022
@PranavMaganti
Copy link
Owner

Fixed in 0.8.1-rc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants