Got some really weird state with script dep’s reso...
# gradle
d
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
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
yep, and problems gone after i rewrite it to kts
next problem is i have 150+ more
e
do you happen to have configuration on demand enabled?
d
nope, it’s disabled, because
nobody really know how to use it properly
)
e
yeah, and because it’s a mess
good, that rules out a large category if problems
d
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
ah, that can explain it then I was about to say that groovy will throw method missing when the configuration doesn’t exist
d
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
TAPI requests currently trigger the configuration of all projects, so I don’t see how it can changes from the cli
d
i could try to create a small reproducible sample
e
if you manage to I’d happily investigate
d
deal
e
d
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
seems you’re fighting with ordering problems then, still no luck creating a reproducer?
d
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.
Copy code
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
👍
m
@dsvoronin where is the sample?
d
Sorry, i got sick. Will do it as soon as I can