Closed marcardar closed 1 year ago
Hello, use platform(…)
.
Are you sure it works without? Unless Gradle did something special, it wouldn't.
Hi Louis, yes it does appear to work at least in my setup (Android-only app). I even cleared all gradle caches just to be sure.
EDIT: oh perhaps those dependencies are being ignored (when not using platform(...)
) and the compose dependencies are being pulled in elsewhere?
EDIT2: Hmm, so I guess my bad. My build script was:
val composeBom = platform(AndroidX.compose.bom)
api(composeBom)
androidTestImplementation(composeBom)
api(AndroidX.compose.material)
debugApi(AndroidX.compose.ui.tooling)
api(AndroidX.compose.ui.toolingPreview)
api(AndroidX.compose.ui.viewBinding)
So I guess those last 4 were pulling in all the necessary compose dependencies when the bom dependency was not configured correctly. Ideally it would have failed when I made that platform
change?
I'm not sure what you mean by not configured correctly. You're properly using platform here.
In the androidx compose documentation, we are encouraged to use
platform
:implementation platform('androidx.compose:compose-bom:2023.06.01')
However, in refreshVersion, it's not clear whether to use:
api(AndroidX.compose.bom)
or:
api(platform(AndroidX.compose.bom))
Both seem to work, but which one should be used?