Closed nordfalk closed 5 months ago
Which dispatcher are you using make sure to use, Dispatchers.Main or Immediate.
Yes, you are right. I was invoking like
val screenshotController = rememberScreenshotController()
val coroutineScope = rememberCoroutineScope()
...
Card(Modifier.attachController(screenshotController) {
... // content
}
Column(modifier = Modifier.clickable {
coroutineScope.launch {
withContext(Dispatchers.IO) {
try {
val bitmap: Result<Bitmap> = screenshotController.captureToBitmap()
Using Kapture, sometimes our app crashes with this exception:
And additionally this exception get thrown:
I believe this is because you are asking to render in a coroutine instead of the main thread.