-
Notifications
You must be signed in to change notification settings - Fork 38
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
Roborazzi 1.37.0 and above brokes almost all screenshots in our app #628
Comments
Thank you for reporting this. I'm not sure why you always have two windows. A project reproducing the issue would be much appreciated. 🙏 |
Could you check if the Activity is being launched twice? It might be because you're using a Compose rule with ActivityScenario.launch, or something else running at the same time. |
Thanks for the advice. Here is an excerpt of our screenshot test code.
When we tried deleting this conditional branch and just calling captureRoboImage with roborazzi 1.39.0 all the time, We could generate normal screenshots. However, the above changes have caused another problem. We will try to create a sample project to reproduce the problem. |
Thank you for providing the updated information. I usually debug this kind of problem by using the debugger in Android Studio when the app seems to freeze or do nothing, to understand what is stopping the tests. |
Thx for your kind advice. |
I will share what we know at this point. Further research will be conducted next week.
I am very surprised that |
It might be a memory leak, but you can try specifying the memory size. I think we need some memory even if we don't have a memory leak. |
Thanks for your kind advice. I tried it, but now I get an AppNotIdleException instead.
However, we have identified the cause. Certain Lottie usage causes this issue. var showAnimation by remember {
mutableStateOf(false)
}
val composition by rememberLottieComposition(
RawRes(R.raw.lottie_animation)
)
val state = animateLottieCompositionAsState(
composition = composition,
speed = if (showAnimation) 1.5f else 0f, // main point
) If rewritten as follows, composeTestRule.setContent can be displayed without problems.
|
Let's summarize.
Since this occurs when Although considered a rare case, if AppNotIdleException or OOM occurs, it may be due to the way Lottie is used. |
We are currently working on fixing the animation problem by introducing |
Thanks for the additional information. This Issue itself has been resolved and will be closed. Thank you for all your kind support. |
We have not yet been able to fully analyze the issue, but #555 has caused almost all screenshots for our app to be just filled with the background color.
Apparently, in the case of our app, even if we don't include Dialog in Previews, the condition of fetchRobolectricWindowRoots ().size > 1 is met and the captureScreenRoboImage is executed.
However, the screenshot we get from it is simply an image filled with the background color.
We're planning to make a sample project that can reproduce this problem, but please give us some time.
If possible, it would be helpful if you could add a flag to always run captureSingleComponent instead of captureScreenRoboImage as described in captureScreenIfMultipleWindows.
The text was updated successfully, but these errors were encountered: