https://kotlinlang.org logo
Title
y

Yingding Wang

01/17/2023, 9:07 PM
I generated a signed bundle for compose wear app, and got an error
cannot find symbol
@Preview()
, during the debug build is everything fine, how can i get my bundle built? I assume the the preview tool is only in debug mode available?
It turns out I defined
debugImplementation
for
androidx.compose.ui:ui-tooling
. I thought the compose preview code shall not be build by the compose compiler for release, why the
debugImplementation
doesn’t work. Is there a way to remove the compose preview code during the release build?
y

yschimke

01/18/2023, 6:16 AM
Yep, this is why there are two ui-tooling jars. One for annotation and one for the preview runtime.
debugImplementation "androidx.compose.ui:ui-tooling:1.3.2"
implementation "androidx.compose.ui:ui-tooling-preview:1.3.2"