I want to use the @Preview
annotation in my brand new Jetpack Compose for Desktop project. However gradle is just not getting it done to fetch the dependecy for that.
my build.gradle.kts
:
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
plugins {
kotlin("jvm") version "1.4.0"
// __LATEST_COMPOSE_RELEASE_VERSION__
id("org.jetbrains.compose") version (System.getenv("COMPOSE_TEMPLATE_COMPOSE_VERSION") ?: "0.1.0-build113")
}
repositories {
jcenter()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
}
buildscript {
repositories {
google()
}
dependencies {
classpath("androidx.ui:ui-tooling:1.0.0-alpha07")
}
}
dependencies {
implementation(compose.desktop.currentOs)
}
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "KotlinJvmComposeDesktopApplication"
}
}
}
It just is not being resolved
Accordingly to the documentation, it should be working for alpha07, but for alpha08 it changed to
androidx.compose.ui:ui-tooling:1.0.0-alpha08
, so, if you can upgrade to alpha08, you can see if it works.https://developer.android.com/jetpack/androidx/releases/ui#declaring_dependencies