paparazzi
paparazzi copied to clipboard
DatePickerDialog Crash when trying screenshot
Dear Paparazzi Team,
I wanted to express our sincere appreciation for the remarkable work you've done with the Paparazzi tool. It has been an invaluable asset to our development process, significantly enhancing our productivity and workflow.
However, we've encountered an issue with the DatePickerDialog that leads to a crash, and we were hoping you could provide some assistance. The crash is related to an unexpected resource format error. Specifically, the error message is as follows:
GRAVE: resources.format: Hexadecimal color expected, found Color State List for @android:color/system_bar_background_semi_transparent
java.lang.NumberFormatException: Color value 'C:/Users/xavi/AppData/Local/Android/Sdk/platforms/android-34/data/res/color/system_bar_background_semi_transparent.xml' has wrong size. Format is either#AARRGGBB, #RRGGBB, #RGB, or #ARGB
at com.android.layoutlib.bridge.impl.ResourceHelper.getColor(ResourceHelper.java:136)
at android.content.res.Resources_Delegate.getColor(Resources_Delegate.java:221)
at android.content.res.Resources.getColor(Resources.java:1065)
at com.android.internal.policy.DecorView.<init>(DecorView.java:313)
at com.android.internal.policy.PhoneWindow.generateDecor(PhoneWindow.java:2385)
at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2727)
at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2144)
at androidx.compose.ui.window.DialogWrapper.<init>(AndroidDialog.android.kt:352)
at androidx.compose.ui.window.AndroidDialog_androidKt.Dialog(AndroidDialog.android.kt:163)
at androidx.compose.material3.AndroidAlertDialog_androidKt.BasicAlertDialog(AndroidAlertDialog.android.kt:157)
at androidx.compose.material3.DatePickerDialog_androidKt.DatePickerDialog-GmEhDVc(DatePickerDialog.android.kt:75)
It appears that a hexadecimal color is expected, but instead, a Color State List is found at @android:color/system_bar_background_semi_transparent. This leads to a NumberFormatException due to an incorrect color value format.
We would greatly appreciate any guidance or updates you could provide to help us resolve this issue. Ensuring the stability and reliability of features like the DatePickerDialog is crucial for our development needs.
Thank you in advance for your time and assistance. We look forward to any possible solutions or workarounds you might suggest.
Hi @xavijimenezmulet, looking at your stacktrace it seems that the issue may be targeting sdk 34. Paparazzi doesn't currently support 34 although there is work being done to fix this targeting Iguana version of layoutlib.
When testing DatePickerDialog in material3 I was able to generate a snapshot of it using api 33. See here.
Hopefully that solves the issue you are having.
Closing, per
- DatePickerDialog issue suggestion by @geoff-powell
- Iguana supported per https://github.com/cashapp/paparazzi/pull/1314