I recently started a new app using Compose. I have AS Hedgehog 2023.1.1 installed. I am using API 34 and get an error in the compose preview. "Render problem" accompanied by a
Layout fidelity warning
The graphics preview in the layout editor may not be accurate:
- The current rendering only supports APIs up to 33. You may encounter crashes if using with higher APIs. To avoid, you can set a lower API for your preview.
How do I set a lower API for previews?
Googling I only find results telling me to drop the API level of the entire app, OR answers from 2 years ago pointing to using a very old version of compose.
Use @Preview(apiLevel = 33), like below
@Preview(apiLevel = 33)
@Composable
fun YourComposablePreview() {
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With