https://kotlinlang.org logo
Title
d

dsvoronin

10/23/2018, 12:50 PM
Got some really weird state with script dep’s resolving:
org.gradle.tooling.BuildException: Could not fetch model of type 'KotlinBuildScriptModel' using Gradle installation '/Users/dsvoronin/.gradle/wrapper/dists/gradle-4.10.2-bin/em75h4kbtmi6i8f32m058ve4q/gradle-4.10.2'.
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method api() for arguments [com.adjust.sdk:adjust-android-criteo:4.15.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
rewriting groovy script to kts in fact solves issue! but thats weird, i have alots of groovy scripts in project (150+)
e

eskatos

10/23/2018, 12:54 PM
the exception comes from a Groovy script 🤔
Caused by: org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/dsvoronin/Work/avito-android/analytics/build.gradle' line: 24
d

dsvoronin

10/23/2018, 12:54 PM
yep, and problems gone after i rewrite it to kts
next problem is i have 150+ more
e

eskatos

10/23/2018, 12:54 PM
do you happen to have configuration on demand enabled?
d

dsvoronin

10/23/2018, 12:55 PM
nope, it’s disabled, because
nobody really know how to use it properly
)
e

eskatos

10/23/2018, 12:55 PM
yeah, and because it’s a mess
good, that rules out a large category if problems
d

dsvoronin

10/23/2018, 12:56 PM
my change was: i’m applying plugins that introduces
api
configuration later than before
in root build script
subprojects
block in dynamic collection block
plugins.withType
. on one of my marker plugin
e

eskatos

10/23/2018, 12:56 PM
ah, that can explain it then I was about to say that groovy will throw method missing when the configuration doesn’t exist
d

dsvoronin

10/23/2018, 12:58 PM
fun fact: gradle cli build of this module successful
problem in groovy vs kts script resolving race
i applied
api
-contributing plugin in buildSrc - all was ok now i’m trying to apply in in root .kts file dynamically, and it fails
only in IDE though
e

eskatos

10/23/2018, 12:59 PM
TAPI requests currently trigger the configuration of all projects, so I don’t see how it can changes from the cli
d

dsvoronin

10/23/2018, 1:00 PM
i could try to create a small reproducible sample
e

eskatos

10/23/2018, 1:00 PM
if you manage to I’d happily investigate
d

dsvoronin

10/23/2018, 1:00 PM
deal
e

eskatos

10/23/2018, 1:01 PM
d

dsvoronin

10/23/2018, 1:27 PM
https://github.com/dsvoronin/gradle-bugs it works fine on simple example problem is masked by another one 😞
i’ll probably need to give up on using markers for configuration, especially when
plugins
block with explicit plugins contrubutes so much for generating accessors in kts
still fighting with that issue
now its’
Caused by: java.lang.IllegalStateException: compileSdkVersion is not specified.
in first android module
but it is specified, and cli gradle build is ok
e

eskatos

10/25/2018, 10:37 AM
seems you’re fighting with ordering problems then, still no luck creating a reproducer?
d

dsvoronin

10/25/2018, 11:57 AM
yep, still no luck
i’d share a project with you privately, but there is a local artifactory overriden everywhere for dependencies
real problem hidden under misleading stacktrace 😞 and i have no idea how to get it. Just trying to disable all custom functionality step by step
also this thing is flaky: sometimes i have this resolution success without any changes.
ava.{util.concurrent.TimeUnit, math.BigDecimal, io.File}},
		exceptions = NO ERROR))
then open another script in IDE and have it all again
tried to clean
./gradle/caches/4.10.2/gradle-kotlin-*
no effect
Good news, @eskatos! I solved an issue and will prepare repro sample tommorow
e

eskatos

10/26/2018, 7:48 AM
👍
m

Mikhail Yudin

10/30/2018, 8:57 AM
@dsvoronin where is the sample?
d

dsvoronin

10/31/2018, 12:51 PM
Sorry, i got sick. Will do it as soon as I can