It's most common bug in Jetpack Compose.
You can solve this issue by following these simple steps:
Use latest version dependency. I am using 1.0.1 implementation "androidx.compose.ui:ui-tooling:1.0.1"
Add background and systemUi in your preview @Preview(showSystemUi = true, showBackground = true)
Use the latest gradle version classpath 'com.android.tools.build:gradle:7.0.0'
Use the latest kotlin version classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
Run the application after applying these changes.
Note: use latest stable version of Android studio 4.2.2 or Latest beta version 2021.1.1 Canary 7 or above.
Android Studio latest stable version(4.2.2) not stable now. It have some gradle issues.
I recommend use beta version to avoid issues.
Android studio beta version link