I’ve installed the plugin but I cannot use the @Pr...
# compose-desktop
f
I’ve installed the plugin but I cannot use the @Preview-Annotation nor do I see the preview icon:
1
a
You need:
Copy code
import androidx.compose.desktop.ui.tooling.preview.Preview
after that you can use @Preview and icon will appear
f
I guess my project setup is wrong.
a
What’s the issue?
f
I’ve just created a plain project using IntelliJ. There is no gradlew - file either in the project directory. In a previous project it was there.
a
Without Gradle it will be pain… Can you create a project using Kotlin wizard?
You miss UI tooling library. Add to your dependencies { .... implementation(compose.uiTooling) }
it is in build.gradle.kts file
f
I’ve created it a second time using the wizard for Compose Desktop Apps in INtelliJ. Now gradlew is there. But the import is not working:
I’m pretty new to gradle. Only used maven so far.
implementation(compose.uiTooling) doesn’t work: nt/build.gradle.kts2128: Unresolved reference: uiTooling
a
Could you share content of your build.gradle file here?
f
Here it is:
a
change id(“org.jetbrains.compose”) version “0.4.0" to id(“org.jetbrains.compose”) version “0.5.0-build235" and refresh gradle (after you edit the file, the grey icons will appear to the left. press both - they will reload libraties)
👍 1
Preview was done only in buil235
f
Thank you so much. It works now.
🥳 2