Jetpack Compose: @PreviewParameter causes Preview to disappear!
Not even a single error was shown

I’ve been exploring Kotlin Multiplatform Mobile lately and using Jetpack Compose on my Android app.
I encountered a very weird scenario where my Preview is not showing! Not even a single error was shown in Android Studio. 🤨

Above is my composable function that I want to preview, but Android Studio is literally showing nothing. Blank. Empty. I’ve been going back and forth to try to discover what’s causing this issue (even googling did not help).
The solution 🤦‍♂️ was…
It turns out that I had my PreviewParameterProvider
declared in private
and turning it to public
or simply removing the visibility modifier fixed it.

This wasn’t even documented!
I hope Google will make it clear in the documentation or at least give an error in Android Studio so developers won’t encounter this frustrating and time-wasting scenario.
I’m writing this in the hope to help someone out there.