Hey - Any ideas on why the deploy preview and live...
# compose
f
Hey - Any ideas on why the deploy preview and live literals wouldn't be working? Not sure if is a compose version problem / configuration. The Preview works, but the deploy/interactive/live litterals just dont show.
y
Just a random guess - do you have both ui-tooling dependencies added? I don't think this is it...
🙌 1
c
I wish the AS team had a better wizard or something to make sure that this stuff worked. Or some kind of health check. The last time I tried adding a @Preview annotation, the IDE gave me one quick fix, but the only reason I got it working was because I came here and asked what else I needed. Turns out I needed like 3 other dependencies. lol
f
Just to make sure, do you have them enabled under the Experimental Preferences in Android Studio?
f
let me check those Experimental Preferences - have to search !
c
What version of Android Studio are you using?
I wish the AS team had a better wizard or something to make sure that this stuff worked.
We are testing / dogfooding Canary regularly, but one of the challenges is that often times Studio canaries lag behind Compose library releases. We catch these breaks internally and fix them, but the fixes sometimes don’t line up week to week.
Though I would say that if these issues are consistently happening with stable versions of Compose in your project, then please report them.
Turns out I needed like 3 other dependencies
I think this also has shifted in flight during the alphas and betas of Compose 1.1. So we should document the needed things and also update our Studio project templates
f
@Chris Sinco [G] so - I tested in both: • Artic Fox 2020.3.1 Patch 3 • Bumblebee 2021.1.1 Canary 13 I eventually was able get some behavior after re-importing my project: • Live literals in AS preview • Deploy to emulator button I was still missing: • Live literals working in emulator • Interactive mode
c
@Chris Sinco [G] I did report the issue! Got closed as obsolete with nothing else for me to work off of. https://issuetracker.google.com/issues/204502651
c
@fabio.carballo for Live Literals, do you see this in the top right corner?
On interactive mode, can you confirm it’s enabled under Preferences > Experimental
f
@Chris Sinco [G] seems I indeed ad the "interactive and animation preview tools" off. Thanks for the tip! I still don't see the "Live Edit of literals: ON", but it seems it is working in the preview now. This started to working after I simply re-imported my project into AS.
c
Gotcha thanks for confirming! On the UI I shared for Live Literals, we only show that when you’ve deployed and connected an app or Preview to a device. It’s appearance though has been a bit flaky so please confirm if you see it after deploying the Composable or app to device.
Glad to know it’s working in Preview
Part of the challenge of Live Literals is we are trying not to build too much “UI” around it because we believe it’s an editing experience that should just work for Preview. That is, the developer should be able to make changes, we update the Preview opportunistically (as much as possible) and then prompt you to rebuild. We hope in the future as Live Literals / Edit evolve, that you’ll have to rebuild less and less.
As for the experience on a device, since the editor and device are disconnected in the UI, we use that “Live Edit of Literals: ON” UI to communicate the state of it.
🙌 1
FYI @Colton Idle that bug is now properly triaged and assigned 🤞
c
Thanks so much! Happy you were able to move it in the right direction.
f
thanks for the clarification!