Monday, July 25, 2022

Jetpack Compose Weird Bugs

Jetpack Compose is very cool and also very buggy.

One bug I just recently squashed had to do with random builds failing with no explainable error message, or a build succeeding which will randomly throw an error looking something like

"Class cast Exception, cannot case LamdaImpl to kotlin.jvm.Function0" or something to that effect.

The error would only happen at runtime and would only happen as a result of a ComposeView calling setContent (in my case from a Fragment class).

Fixes usually are some flavor of clean and rebuild, but what helped me especially was also double checking that the gradle configuration property "parallel" was off in my gradle.properties file, and that "compile in parallel" was unchecked in the Android Studio settings.

That was a fun two days.

Stay tuned!

========================
Follow pyamsoft around the Web for updates and announcements about the newest applications!
Like what I do?

Send me an email at: pyam.soft@gmail.com
Or find me online at: https://pyamsoft.blogspot.com

Follow my Facebook Page
Check out my code on GitHub
=========================