As I am exploring JetPack Compose
and Tooling
for it, I came across the wonderful PreView
feature of it. Although I can see the preview in Split and Design window, when tried to deploy it in an emulator, I found this error.
androidx.compose.ui.tooling.preview.PreviewActivity is not an activity subclass or alias
I am using
Android Studio Arctic Fox| 2020.3.1 RC1
activityComposeVersion = "1.3.0-rc01"
composeVersion = "1.0.0-rc02"
kotlinVersion = "1.5.10"
I was trying to deploy preview of GradientTintedIconButtonPreview()
@Preview
@Composable
fun SquareComposablePreview() {
Text("Hello World")
}
@Preview
@Composable
fun ComposablePreview() {
Text("Hello World")
}
These two Composable is identical. For SquareComposablePreview
the preview runs without an issue, but for ComposablePreview
is am getting the error.
Am I doing something wrong of there are issue with the tool !