roborazzi: Can't update dependency kotlinxSerialization to 1.7.2

hello we’re trying to update org.jetbrains.kotlinx:kotlinx-serialization-json from 1.7.1 to 1.7.2, but

got error like:

* What went wrong:
Execution failed for task ':ui:app-review:app-review-common:finalizeTestRoborazziDebug'.
> Could not initialize class com.github.takahirom.roborazzi.CaptureResults

p.s. according to the changelog , seems is this change caused it : image

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 19 (16 by maintainers)

Most upvoted comments

Ok so after digging in more I found another plugin that was leaking kotlin stdlib 2.+ thru its dependencies into the build dependencies classpaths. Oddly it would auto resolve the 2.0.10 down to a 1.9 version in some cases hiding the issue longer than I would have expected. None of that had to do directly with kotlinx serialization directly though so I suspect there is some sort of dynamics at play at runtime that trigger the behavior change to break in the razzi tasks. Once I got the build classpath sorted such that all of the plugins and libraries top out in the kotlin 1.9 range everything is fine.

image

I still have some plugins that depend on things like okio pulling in with them stdlib 2.+ but it doesn’t seem to bother razzi I assume from those tasks not being used in the same invocation as when we run the tests.

I think the problem is that roborazzi is attempting to use the new Uuid type in kotlin 2.0.20, but gradle forces kotlin 1.9 still

I see the gradle plugin depends on/uses roborazzi-core here: https://github.com/takahirom/roborazzi/blob/main/include-build/roborazzi-gradle-plugin/build.gradle#L17

We do see a possibly slightly related issue

Could not initialize class com.github.takahirom.roborazzi.CaptureResults
> Exception java.lang.NoClassDefFoundError: kotlin/uuid/Uuid [in thread "Execution worker Thread 4"]
....
....
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NoClassDefFoundError: kotlin/uuid/Uuid [in thread "Execution worker Thread 4"]