Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The ComposeView adapter does not work in a variant other than debugging

so the problem is i cannot see my preview of compose when set build variant different than debug. Any ideas how to enable this on different build variants? I tried add initWith(buildTypes.debug) but nothing change. enter image description here

like image 689
Developer534255 Avatar asked Nov 03 '25 17:11

Developer534255


1 Answers

Got the same issue. It's funny but you have to add

[buildTypeName]Implementation "androidx.compose.ui:ui-tooling:$compose_version"

to app's level build.gradle to make it work for build type other than debug

//i.e. for [dev] build type:
devImplementation "androidx.compose.ui:ui-tooling:$compose_version"
like image 50
DKavaliou Avatar answered Nov 05 '25 15:11

DKavaliou



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!