-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jetpack Compose previews crashes #250
Comments
Hey @dees91 , Just out of curiosity, did you try latest stable version also, 1.6.0? Do you have the same problem there? |
Yes I have the same problem using version 1.6.0 |
Could this https://issuetracker.google.com/issues/254315195 or https://issuetracker.google.com/issues/281014894 be somewhat related? |
A bit more updates: I've narrowed it down to code that uses reflection to call functions from other providers. E.g. in your example, |
Yes, I confirm that |
No problem, glad at least some parts can be of use for now. |
So faker uses kotlin-faker/core/src/main/kotlin/io/github/serpro69/kfaker/FakerService.kt Lines 582 to 584 in caf10e6
I'm not sure what else we could do here but wait for the fix. Of course implementing #23 would also help here. But I'm not sure if I'll be able to tackle that one quick enough :/ |
Hey @dees91 , Note that while regular functionality should work fine now, things like e.g. unique data generation might still produce same exceptions in compose preview because that part of faker still depends on reflection. |
it looks like the preview is being generated now 🎉 But I can't build and run the app using
I wonder if it's because it's a snapshot version? or did I connect something wrong? here's the commit: dees91/Faker-preview-issue@655ea7c |
Thanks for the confirmation. That error is weird. I can't see what changes could have caused this since rc.6 So I guess you needed to explicitly add kotlin-reflect dependency to make it work? I'll look into this in #253 |
Problem Description
Jetpack Compose preview throws an error when I create a preview using
PreviewParameterProvider
that utilizes a faker with a provider, such as address.Faker Version Used
2.0.0-rc.6
Stacktrace
(observed in Android Studio logs
~/Library/Logs/Google/AndroidStudio2024.2/idea.log
):In the logs I also found:
I've created sample reproduction: https://github.com/dees91/Faker-preview-issue
The text was updated successfully, but these errors were encountered: