I’m making a project in Android with Jetpack Compose. I want to use a dynamic color theme but it’s not working for Android API level 34 (it works well on 32-33). Dynamic colors are not working in the preview as well as any API 34 device.
I’ve confirmed that my SDK tools are well-upgraded.
Can anyone help regarding the issue?
versions:
kotlin = “1.9.0”
activityCompose = “1.9.0”
androidx-material3 = { group = “androidx.compose.material3”, name = “material3”, version = “1.2.1” }
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_YES,
apiLevel = 33,
wallpaper = Wallpapers.RED_DOMINATED_EXAMPLE,
name = "API 33"
)
@Preview(
uiMode = Configuration.UI_MODE_NIGHT_YES,
apiLevel = 34,
wallpaper = Wallpapers.RED_DOMINATED_EXAMPLE,
name = "API 34"
)
@Composable
fun HomeScreenPreview() {
HomeScreen()
}
Output
I tried to clean the build and remake whole project. Also installed the latest tools.
Jay malaviya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.