Missing Classes and Functions in Jetpack Compose Compiler Reports, and How to Fix

Quick article on how to obtain missing information in Jetpack Compose Compiler Reports by specifying “rerun tasks”.

Brian Terczynski
2 min readNov 29, 2023

Compose Compiler Reports can be useful to diagnose UI jank in Compose screens. But often the information I am looking for is missing. For instance, if my Compose screen is janky, I might want to look at the classes.txt file to see if my model/data class has any unstable fields in it, or if the whole class itself is unstable. But a lot of times that class is missing from the report. The setup I have is similar to the one described here (in my case the Compose Compiler runs automatically for particular build flavors/dimensions rather than specified as a command-line property).

This likely happens because of incremental builds with Gradle. Only certain files may be recompiled, and as such only certain classes and composable functions will be included in classes.txt , composables.txt , etc.

To remedy this, I use --rerun-tasks . So I’ll go to the command line and run my Gradle compile command with this option, e. g.:

gradlew --rerun-tasks compile<...>

Of course such a command can take a long time to run especially for large codebases. But usually I just need to do this once to see all involved classes/Composables that have stability issues, and I can then fix all of them at once. Then, incremental compiles on those fixed classes will often surface just those classes in the report to show me if they indeed got marked as “stable”, etc. And then I can use the other techniques described here to further test the performance of my Compose screen. So it usually isn’t too bad.

So if you find that the information you are looking for in Compose Compiler Reports is missing, --rerun-tasks is one thing you can try to remedy this.

--

--

Brian Terczynski
Brian Terczynski

Written by Brian Terczynski

Documenting my learnings on my journey as a software engineer.

No responses yet