My app uses material2, will I run into a problem i...
# compose-android
c
My app uses material2, will I run into a problem if I have a transitive dependency on material3?
j
I recently used an M3 app that depended on an M2 library and the only thing I saw as an issue was the theming didn’t apply between them (I may not have configured it properly to support both). So if your app is set up with M2 and then you tried to use any Composables from the library that introduced the transitive dependency then you might see a difference in the themes. But the migration guide suggests having both M3 and M2 side-by-side while migrating so it shouldn’t cause anything to break. https://developer.android.com/jetpack/compose/designsystems/material2-material3
s
No issues regarding gradle and so on, having both of them is perfectly fine. But you will have to either decide to make your app work with both at the same time, or make a grand migration (super hard to do in one sweep). For this “both at the same time” world, I had to do something like this, and basically setup both of them so that all tour composition locals are correct at any part of the app. Then if you got your custom components which may be called using m2 or m3 containers, and their content may be for example an m2.Text or an m3.Text, you need to do stuff like this so that it supports both cases.
c
Thanks folks. I was able to get it working (phew)
I was a bit nervous about it because I had to deliver something by EOD and was only just starting it that day 😬