I've been waiting for Paparazzi 2.0.0-alpha05.2 fo...
# squarelibraries
e
I've been waiting for Paparazzi 2.0.0-alpha05.2 for months, so I forked Paparazzi (https://github.com/eygraber/paparazzi) and merged all of the PRs through that milestone. Group ID is
com.eygraber
and Gradle Plugin ID is
com.eygraber.paparazzi
if anyone else wants to try it. Looking forward to getting back onto the upstream ASAP 😅
😅 2
thank you color 2
K 9
d
I've tried updating to your fork (and all my AGP 9 migrations that were blocked behind this) and it seems to mostly work, however I am getting a warning
project ':composeApp': Test model failure
Copy code
org.gradle.api.InvalidUserCodeException: Querying the mapped value of task ':composeApp:transformAndroidHostTestClassesWithAsm' property 'jarsOutputDir' before task ':composeApp:transformAndroidHostTestClassesWithAsm' has completed is not supported
	at org.gradle.api.internal.provider.TransformBackedProvider.lambda$beforeRead$0(TransformBackedProvider.java:98)
	at org.gradle.api.internal.provider.ValueSupplier$TaskProducer.visitContentProducerTasks(ValueSupplier.java:134)
	at org.gradle.api.internal.provider.TransformBackedProvider.beforeRead(TransformBackedProvider.java:95)
	at org.gradle.api.internal.provider.TransformBackedProvider.calculateOwnValue(TransformBackedProvider.java:80)
	at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateValue(AbstractMinimalProvider.java:115)
	at org.gradle.api.internal.provider.FlatMapProvider.calculateOwnValue(FlatMapProvider.java:53)
	at org.gradle.api.internal.provider.AbstractMinimalProvider.calculateOwnPresentValue(AbstractMinimalProvider.java:80)
	at org.gradle.api.internal.provider.AbstractMinimalProvider.get(AbstractMinimalProvider.java:100)
	at org.gradle.api.internal.provider.ProviderResolutionStrategy$2.resolve(ProviderResolutionStrategy.java:32)
	at org.gradle.api.internal.file.collections.ProviderBackedFileCollection.visitChildren(ProviderBackedFileCollection.java:63)
	at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:112)
	at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:361)
	....
AI seems to believe this is a genuine bug (below is copy from AI investigation, might be incorrect): > I dug into the actual bytecode of the plugin jar Gradle resolved, and found the exact cause — and it's actually a regression introduced by the very fork/version bump you just did, not something the update was supposed to fix. > What I found: > 1. Your libs.versions.toml now points paparazzi at com.eygraberpaparazzi2.0.0-alpha05.2 (a fork used specifically because it's ahead of upstream on AGP 9 / com.android.kotlin.multiplatform.library support — your own comment references paparazzi milestone 24). > > 2. I decompiled the actual plugin jar Gradle downloaded (paparazzi-gradle-plugin-2.0.0-alpha05.2.jar) and compared it against the upstream app.cash.paparazzipaparazzi gradle plugin2.0.0-alpha05.jar. The fork's PaparazziPlugin.class is more than double the size (2854 vs 1334 decompiled lines) and contains an entirely new method that doesn't exist upstream at all: >
Copy code
private final void includeOnlyPaparazziTests(Test)
>        0: aload_1
>        1: Test.getTestClassesDirs()
>        4: FileCollection.getFiles()   // <-- eagerly resolves the FileCollection
>        ...
>        walkTopDown() over each directory, reading raw .class bytes
>        to detect whether a test class references the Paparazzi API
> This is a new optimization (added only in the fork) that scans compiled test .class files to skip running host tests that don't actually use Paparazzi. To do that, it forces a synchronous read of Test.getTestClassesDirs().getFiles(). > > 3. Under AGP 9's new com.android.kotlin.multiplatform.library android block, the compiled classes for androidHostTest are routed through transformAndroidHostTestClassesWithAsm — which is itself created because Paparazzi registers its own ResourcesCompatVisitorFactory ASM instrumentation (used to patch font/resource loading for host-side rendering). So Paparazzi both creates that transform task and then, in its new test-filtering feature, reads its output (jarsOutputDir) before Gradle guarantees the transform has finished — exactly the InvalidUserCodeException you're seeing.| > > Why the update didn't help: the fork's whole reason for existing (AGP 9 compatibility work) is what introduced this new bytecode-scanning feature, and that feature has its own internal ordering bug against the very androidHostTest/ASM-transform pipeline it's meant to support. There's no extension/DSL flag to disable this scan — I checked the whole plugin class for a toggle and found none. > > Recommendations: > • Treat this as a genuine upstream bug in the com.eygraber/paparazzi fork's new includeOnlyPaparazziTests feature — worth filing/checking their issue tracker (this is a very recent, actively-iterated fork given the .2 patch suffix, so a fix may land soon). > • Since it currently only surfaces as a logged warning rather than a hard build failure, it's likely safe to keep going for now. > • If it starts failing the build outright (Gradle is moving toward making these hard errors), the safest interim options are: pin to an earlier/non-AGP9 paparazzi build combined with reverting to AGP 8 (the previously-documented working combo), or wait for the next fork patch release. Just incase anyone else goes down the rabbit hole...
e
FWIW all I did was merge the open PRs through that milestone, so you may want to find the one that introduced that upstream and report it (I personally haven't seen this issue though)