https://kotlinlang.org logo
#compose
Title
# compose
b

buszi0809

01/05/2021, 6:15 PM
I'm tryna use Jetpack Compose with latest 1.0.0-alpha09 version and I can't find @Preview. Did they delete it?
m

magnumrocha

01/05/2021, 6:17 PM
I think they not release the
ui-tooling
version
1.0.0-alpha09
yet
b

buszi0809

01/05/2021, 6:18 PM
So i have to use 1.0.0-alpha08 to use it?
m

magnumrocha

01/05/2021, 6:19 PM
the last
ui-tooling
version release is
1.0.0-alpha07
b

buszi0809

01/05/2021, 6:20 PM
Thanks a lot
m

magnumrocha

01/05/2021, 6:20 PM
you can do:
Copy code
implementation 'androidx.compose.ui:ui:1.0.0-alpha09'
implementation 'androidx.ui:ui-tooling:1.0.0-alpha07'
it works but, the
@Preview
will not work properly
b

BenjO

01/05/2021, 6:20 PM
I'm using
androidx.compose.ui:ui-tooling:1.0.0-alpha09
without a problem 🤔
m

magnumrocha

01/05/2021, 6:21 PM
Copy code
Execution failed for task ':samples:android:mergeDebugResources'.
> Could not resolve all files for configuration ':samples:android:debugRuntimeClasspath'.
   > Could not find androidx.ui:ui-tooling:1.0.0-alpha09.
     Searched in the following locations:
       - <https://kotlin.bintray.com/kotlinx/androidx/ui/ui-tooling/1.0.0-alpha09/ui-tooling-1.0.0-alpha09.pom>
       - <https://dl.google.com/dl/android/maven2/androidx/ui/ui-tooling/1.0.0-alpha09/ui-tooling-1.0.0-alpha09.pom>
       - <https://jcenter.bintray.com/androidx/ui/ui-tooling/1.0.0-alpha09/ui-tooling-1.0.0-alpha09.pom>
       - <https://jitpack.io/androidx/ui/ui-tooling/1.0.0-alpha09/ui-tooling-1.0.0-alpha09.pom>
     Required by:
         project :samples:android

Possible solution:
 - Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
how?
b

BenjO

01/05/2021, 6:21 PM
let me check the repos
m

magnumrocha

01/05/2021, 6:22 PM
Copy code
Execution failed for task ':samples:android:mergeDebugResources'.
> Could not resolve all files for configuration ':samples:android:debugRuntimeClasspath'.
   > Could not find androidx.ui:ui-tooling:1.0.0-alpha08.
     Searched in the following locations:
       - <https://kotlin.bintray.com/kotlinx/androidx/ui/ui-tooling/1.0.0-alpha08/ui-tooling-1.0.0-alpha08.pom>
       - <https://dl.google.com/dl/android/maven2/androidx/ui/ui-tooling/1.0.0-alpha08/ui-tooling-1.0.0-alpha08.pom>
       - <https://jcenter.bintray.com/androidx/ui/ui-tooling/1.0.0-alpha08/ui-tooling-1.0.0-alpha08.pom>
       - <https://jitpack.io/androidx/ui/ui-tooling/1.0.0-alpha08/ui-tooling-1.0.0-alpha08.pom>
     Required by:
         project :samples:android

Possible solution:
 - Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
b

BenjO

01/05/2021, 6:24 PM
I have
Copy code
google()
 jcenter()
 mavenCentral()
as repositories. does it help ?
m

magnumrocha

01/05/2021, 6:25 PM
I have too, but google release they tools on they own repository
google()
b

buszi0809

01/05/2021, 6:29 PM
I changed to 07 beta and I got it, when I switch to 09 I don't even have tooling package in ui package
m

Matt Lien

01/05/2021, 6:34 PM
You can see the link above for some more context. But ui-tooling was renamed.
Copy code
const val ui_tooling = "androidx.compose.ui:ui-tooling:${Versions.androidx_ui_tooling}"
b

buszi0809

01/05/2021, 6:37 PM
This still doesn't really explain what happened to @Preview and how to preview a composable in beta 09, I can't find a clue in these release notes
b

BenjO

01/05/2021, 6:38 PM
can you show us your dependency declaration in the build.gradle file ?
b

buszi0809

01/05/2021, 6:40 PM
Copy code
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.ui:ui-tooling:$compose_version"
the version is specified in project gradle file, and its 1.0.0-alpha09
b

BenjO

01/05/2021, 6:41 PM
As @Matt Lien said, it's now androidx.compose.ui
b

buszi0809

01/05/2021, 6:44 PM
Oh my god I didn't spot the difference in dependency, thanks a lot