Hello. I tried to do a preview for an Icon (Compos...
# compose
i
Hello. I tried to do a preview for an Icon (Compose Multiplatform, commonMain folder), but have an issue with painterResources. Maybe someone has already faced with the same issue?
Copy code
@Preview
@Composable
private fun ButtonPreview() {
    MaterialTheme {
        Icon(painterResource(Res.drawable.ic_plus_circle_add_filled), "")
    }
}

Issue:


java.lang.NullPointerException
  at _layoutlib_._internal_.kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith   ...
(ContinuationImpl.kt:33)
  at _layoutlib_._internal_.kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
  at _layoutlib_._internal_.kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
  at _layoutlib_._internal_.kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
  at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
  at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt.runBlocking  at _layoutlib_._internal_.kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
c
I have the same issue when using Drawables in the View it doesn’t render.