Closed jmartinesp closed 5 months ago
We have this as a workaround:
Paparazzi(
environment = detectEnvironment().run {
copy(compileSdkVersion = 33, platformDir = platformDir.replace("34", "33"))
},
)
That allows us to use compile and target sdk 34 while keeping Paparazzi on 33 until it supports the newer platform version. I assume it needs a layoutlib update
Note the above solution can require more work if your CI uses ephemeral nodes. You will need to ensure that SDK 33 is also actually installed
Note the above solution can require more work if your CI uses ephemeral nodes. You will need to ensure that SDK 33 is also actually installed
Can confirm. I couldn't use sdkmanager (sdkmanager --install "platforms;android-33"
) in our CI, so to fix this I added empty module having compileSdk = 33
(while everything else is compileSdk = 34
), which made AGP to install both 33 & 34 in build time.
It looks like AS Hedgehog handles previews properly, whilst Giraffe Patch 1 is failing to render previews for such composables. I guess this would stick for a while until the next patch for Giraffe with SDK 34 support or Hedgehog is released.
Wait giraffe breaks compose previews on sdk 34?
Seems so, tested the same composable on Giraffe Patch 1 and Hedgehog Canary 16, and Giraffe renders 1x1px previews with compile SDK 34.
Upd: it renders regular composables, just fails on dialog and popups
I had the same issue, and got it working with the workaround of setting environment to 33. However, now my tests randomly fail with Resources$NotFOundException while it succeedes when I run them for a 2nd time... So I am not sure why.
Tried with 1.3.2-SNAPSHOT.
Also, Hedgehog indeed breaks previews in AndroidStudio of my AlertDialogs.
Snapshot 1.3.2-SNAPSHOT doesn't work for us. Is this fix targeting into 1.3.2?
Snapshot 1.3.2-SNAPSHOT doesn't work for us. Is this fix targeting into 1.3.2?
👋 @pstambrecht
The bug is strictly dependent on the layoutlib. Paparazzi only updates to the most recent stable layoutlib. Until a stable build of layoutlib from AS Hedgehog that properly supports SDK 34 is released, I doubt something can be done without working around layoutlib internals. It looks like 🦔 has reached RC2 so the first release might be soon-ish 🤞.
Looks like this won't be possible until Iguana, tracked in https://github.com/cashapp/paparazzi/issues/1220.
Compare Hedgehog to Iguana noting this commit, in particular:
Somehow it works now for me again. I use Buildtools version 34.0.0, and compileSdk 34. With latest Android SDK updates from check for updates dialog in Android studio. (Paparazzi 1.3.3)
However, I do have targetted Android 33. But that failed for me as well for Dialogs before. So FYI,
Description Our tests with
AlertDialog
compose components are failing with stacktraces like this after settings bothcompileSdk
andtargetSdk
to34
.Steps to Reproduce Record screenshots of composables with
AlertDialogs
when usingcompileSdk
andtargetSdk
set to 34.Expected behavior The screenshots should be recorded.
Additional information: