Customer was unable to take screenshot on a full compose app. I was able to reproduce by installing Appcues into NowInAndroid. the error message suggest that the method we were using for taking screenshots is probably not the most recommended, so for API 26+ I switched to an approach that uses PixelCopy.
When I changed to PixelCopy I noticed that the screenshot was being taken on the mainThread (probably) causing the visibility animation of the FAB to lag for some frames, so I changed our internal logic, we now wait for the fab to dismiss before taking the screen shot, this also means that we don't need to "prepare" and "restore" anymore as the FAB is no longer there.
Customer was unable to take screenshot on a full compose app. I was able to reproduce by installing Appcues into NowInAndroid. the error message suggest that the method we were using for taking screenshots is probably not the most recommended, so for API 26+ I switched to an approach that uses PixelCopy.
Tested on API 22, 25, 26, 32