https://kotlinlang.org logo
#fleet
Title
# fleet
r

ribesg

03/01/2024, 9:56 AM
I don't understand how you're supposed to see @Preview output in Fleet. I have the right dependency, the right annotation on a @Composable with no parameters. I found "Open Compose Preview Output" and "Reload Compose Preview" actions but it does nothing
2
r

Richard

03/01/2024, 9:59 AM
Left of your
private fun Preview()
there is a compose icon that you can click. I was only able to see said icon when I added desktop target.
message has been deleted
r

ribesg

03/01/2024, 10:01 AM
It's not there, I have desktop target as I usually use desktop preview in IntelliJ
r

Richard

03/01/2024, 10:01 AM
You are on the latest Fleet version?
r

ribesg

03/01/2024, 10:02 AM
Yes. After editing the file and saving, reopening the project, doing that multiple times, at some point it finally appeared, not sure what fixed this. It doesn't work anyway
message has been deleted
same 2
c

curioustechizen

03/01/2024, 10:03 AM
I think I read somewhere that the current version of Fleet only supports previewing composables that don't accept any parameters.
r

ribesg

03/01/2024, 10:03 AM
Maybe that is too complex
w

Wout Werkman

03/01/2024, 10:29 AM
Hey Gael! Quite likely the build we run for the preview fails. There is a critical regression which makes that the build output is not visible anymore. You can vote and follow the progress here FL-25027. I'm trying to have the fix available as soon as possible for you! :).
👍 3
In the meantime. Could you try to run it again, and then invoke the action "Open Compose Preview Output"? This will try to open the build output. From here we might be able to solve why the build fails for you.
r

ribesg

03/01/2024, 10:54 AM
Oh, I thought the output was the view, not the logs. Maybe rename it to Logs? I really expected this option to open the side panel
It really doesn't do anything anyway right now
w

Wout Werkman

03/01/2024, 10:56 AM
Hmm, which Fleet version are you using?
r

ribesg

03/01/2024, 10:56 AM
I tried to restart Fleet to try again and it says this
message has been deleted
After restarting Fleet, I have an output.
Copy code
* What went wrong:
Cannot locate tasks that match 'CinematicJourney:configureDesktopPreviewDesktop' as project 'CinematicJourney' not found in root project 'CinematicJourney'.
Looks like it expects a subproject for some reason
👀 1
My project is open source, I'm making it specifically to be able to test stuff and easily share reproducers https://github.com/wizbii/CinematicJourney
w

Wout Werkman

03/01/2024, 11:00 AM
I tried to restart Fleet to try again and it says this
You can vote for this issue here: FL-25040!
👍 1
My project is open source, I'm making it specifically to be able to test stuff and easily share reproducers https://github.com/wizbii/CinematicJourney
That's amazing, I'll jump right on it, thanks!
r

ribesg

03/01/2024, 11:01 AM
It intentionally does not use the KMP project generator or any IDE generated project, I wanted to know how to make a KMP project from an empty folder, and never saw a use for a subproject
@Wout Werkman I just pushed the exact code I was using locally for those tests
🙏 1
d

Dmitry Stakhov

03/13/2024, 8:09 AM
Hi guys, I added the common Preview annotation and tried to build the preview in Fleet, but it failed with the error. What can be the reason?
Copy code
FAILURE: Build failed with an exception.

* What went wrong:
Task 'configureDesktopPreview__COMPOSE_PREVIEW__' not found in project ':sdks:ui'.
👀 1
r

ribesg

03/13/2024, 8:46 AM
Both Desktop Preview and Common Preview work for me in the latest Fleet version
🔥 1
d

Dmitry Stakhov

03/13/2024, 8:58 AM
Oh, I just feagured out I don't have a desktop target, since I use Compose multiplaform for Android and iOS targets. Should it be fixed if I add desktop target only to use it in fleet preview?
w

Wout Werkman

03/13/2024, 9:01 AM
There is a good chance that adding a desktop target will help in this case, but it shouldn't be necessary. The error you showed seems to be an error on our side. One advantage of adding a desktop target is that previews that use expect functions will now work (without a desktop target, we generate stubs for your expects that throw a runtime exception).
r

Richard

03/13/2024, 9:02 AM
This is good to know, thanks 🙂
d

Dmitry Stakhov

03/13/2024, 9:04 AM
@Wout Werkman in such case do you want me to make a reproducer for you?
🔥 1
w

Wout Werkman

03/13/2024, 9:04 AM
That would be extremely valuable, I would love that!
👍 2
48 Views