hello people How can I convert this to kotlin DSL?...
# android
s
hello people How can I convert this to kotlin DSL?
debugimplementation = "com.squareup.leakcanary:leakcanary-android:$Versions.leakCanary"
p
debugImplementation("com.squareup.leakcanary:leakcanary-android:${Versions.leakCanary}")
s
nop
unresolved reference
unresolved reference for android also
l
@Sergio C. Is
Versions
written in a Groovy based gradle script?
s
its a .kts file
Versions.kts
ohh now it works after invalidating caches and restart
🙄
any ideas why
android
is not resolving?
this is all too buggy
l
@Sergio C. Please, be specific about what
android
you're talking about exactly in which context, I only realize what it could be now. So, I assume you mean
android { … }
in the
build.gradle.kts
file. I had it in red very very often on Android Studio 3.5 and before, but I'm no longer seeing the issue in Android Studio 3.6, so I can only encourage you to keep using Android Gradle plugin 3.5.0 but open the project with 3.6 Canary, you'll very likely get a better experience.
g
You have
android
and all other type-safe accessors if you use plugins DSL to apply plugins
s
yes it's the
android { … }
block in the
build.gradle.kts
Well this took a while to debug. I found out that if you have some error somewhere else in the script that error might not get highlighted by the IDE but android block and everything inside is in screaming error red! ooohh ok then!
tried the AS 3.6 canary 12 and all the latest betas of gradle. Looks like to me this is still a bit rough around the edges
g
Yes, tooling is not perfect. Not sure on which version of Idea As 3.6 is based on, but 3.5 is quite old and Idea 2019.2 is much better with Kotlin DSL than 2019.1