I’m stuck with a problem in my Android app. I made a custom Checkbox using Jetpack Compose. It’s inside a Surface with a clickable modifier. But when I try to build it, I get a weird error: Exception during IR lowering.
hey there! have you tried using a different layout? sometimes Row() or Column() can be more forgiving than custom layouts. also, whats your compileSdkVersion? i had similar weirdness and bumping it up helped. curious to hear if you’ve experimented with different composables or layouts? maybe theres a simpler way to achieve what youre after?
I’ve encountered a similar issue before, and it can be quite frustrating. One possible solution is to use the clickable modifier directly on the CustomSurface instead of using onTap. This approach often resolves the IR lowering exception. Try modifying your code like this:
If this doesn’t work, consider updating your Compose version to the latest stable release. Newer versions often include bug fixes for such issues. Also, ensure that all your Compose-related dependencies are using consistent versions to avoid conflicts.
yo, that error sounds like a pain! have u tried wrapping ur CustomSurface in a Box composable? sometimes that helps with weird click issues. also, double-check ur gradle dependencies - mismatched versions can cause funky errors. if nothing else works, maybe try a different approach entirely? like using a regular Checkbox with a custom look?