Daren Burke
10/10/2025, 11:16 AMCaleb Cushing
10/10/2025, 7:07 PMMike Wacker
10/10/2025, 7:46 PMExecution failed for task ':app:test'.
> Cannot cast object 'org.gradle.internal.serialize.codecs.core.ClosureCodec$BrokenObject@46f481e2' with class 'org.gradle.internal.serialize.codecs.core.ClosureCodec$BrokenObject' to class 'com.avast.gradle.dockercompose.TasksConfigurator'
The issue includes a fairly simple MCVE.Suresh Vadlamudi
10/10/2025, 7:50 PMMatthew Von-Maszewski
10/10/2025, 9:25 PMColton Idle
10/10/2025, 9:27 PMbuildscript {
// this is all I have left to migrate
ext.kotlin_version = '1.9.24'
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath 'com.android.tools.build:gradle:8.10.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath "org.jacoco:org.jacoco.core:0.8.13"
}
}
it seems like theres no way to just migrate to new plugins block directly... instead you have to lookup the documentation for each plugin. am i correct in my understanding? and what do i do if a plugin doesn't publish how to use the new plugins block (like butterknife)?Harry Jackson
10/11/2025, 12:05 AMHarry Jackson
10/11/2025, 12:06 AMAllan Kelly
10/11/2025, 7:53 AMMaksym Moroz
10/11/2025, 3:29 PMafterEvaluate
but since this discussion about just how much of a legacy approach afterEvaluate
is, I have been looking for a good solution for this.
Would BuildService
with FinishEventListener
that throws if plugins were not applied be an idiomatic approach?Adam
10/11/2025, 4:35 PMbuildInvocationId
, workspaceId
, or userId
- just getFailure()
.ScØtty Kauppinen
10/11/2025, 8:42 PMjava.io.IOException: Unable to delete directory 'C:\Users\scott\Documents\ClearEntry
Maksym Moroz
10/13/2025, 11:07 AMproject.rootProject.subprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class.java) {
compilerOptions {
freeCompilerArgs.add("-Xsam-conversions=class")
}
}
}
From what I could look up it seems this behaviour should be now enabled by default but Gradle documentation still mentions this
https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin_compiler_arguments
What am I missing?Sebastian Schuberth
10/13/2025, 11:42 AMVlastimil Brecka
10/14/2025, 12:51 AMdetektMain
tasks, but from within a current project's (app-a
) dependency graph (not globally; I have multiple apps in the total build)
tasks.register("detektAllDebug") {
group = "verification"
def projects = collectDependencyProjects(project(":foo:app"))
def tasks = collectTasks(projects, "detektMain")
tasks += "detektMockFakeFaceRecoFakeEsimStableDebug"
tasks += "detektMockRealFaceRecoRealEsimStableDebug"
dependsOn tasks
}
I have something like this
static Set<Project> collectDependencyProjects(project) {
def collectedProjects = [].toSet()
doCollectDependencyProjects(collectedProjects, project)
collectedProjects.remove(project) // Remove root
return collectedProjects
}
static void doCollectDependencyProjects(collectedProjects, project) {
if (collectedProjects.contains(project)) return
collectedProjects.add(project)
def subProjects = project.getConfigurations()
.inject([]) { acc, config -> // Accumulate all
def configName = config.getName()
// Ignore test projects
if (configName != "testImplementation" && configName != "testApi") {
def dependencies = config.dependencies.withType(ProjectDependency)
if (dependencies.size() > 0) {
acc.addAll(dependencies)
}
}
acc
}
.collect { it.getDependencyProject() } // Map
for (subProject in subProjects) {
doCollectDependencyProjects(collectedProjects, subProject)
}
}
static def collectTasks(subprojects, name) {
def allTasks = []
for (project in subprojects) {
def task = project.tasks.findByName(name)
if (task != null) {
allTasks += task
}
}
return allTasks
}
where I recurse into the graph and collect
Works, but I have feeling there is more gradle-y wayjensen jiu
10/14/2025, 7:43 AMMaksym Moroz
10/14/2025, 12:54 PMlayout.buildDirectory.file("intermediates/***/***.txt")
Charbel Sadaka
10/14/2025, 1:18 PMFileOperations
class to create the zip archive using the zipTree
.
Can someone please refer or attach a sample on how can i continue the workflow to deploy it on a maven repoMike Wacker
10/14/2025, 4:42 PMcom.avast.gradle.docker-compose
plugin (version 0.17.18
).
With the configuration cache disabled, it runs, e.g., in this order: :lib1:composeUp
, :lib1:test
, :lib1:composeDown
, :lib2:composeUp
, :liib2:test
, :lib2:composeDown
. But with the configuration cache enabled, it looks like it runs :lib1:composeUp
and :lib2:composeUp
in parallel first. Which can cause issues if there are port conflicts between those two tasks. I've attached an MCVE.Martin
10/15/2025, 3:16 PMfoo=bar
to my root project gradle.properties
, how is this working if this same root project becomes an included build?
1. The main build value is used
2. The included build value is used
3. It depends
If 3., how can I tell?Edwin Günthner
10/16/2025, 11:54 AMtestFixturesImplementation("org.apache.commons:commons-lang3")
toolsImplementation("org.apache.commons:commons-lang3")
and that was sufficient to compile our kotlin unit tests.
Today, I started the work to upgrade out build setup to use kotlin 2.2.20 (from 1.9.22 before), and now those kotlin unit tests using lang3 don't compile any more.
e: file:///Volumes/Whatever/.../foo/src/testFixtures/kotlin/.../Blub.kt:23:27 Unresolved reference 'lang3'.
(and similarly, another kotlin unit test that relies on src/tools/java ... also doesn't see those classes any more.Robert Elliot
10/16/2025, 2:18 PM~/.gradle/caches/build-cache-1
between runs.
Unfortunately this means periodically when two builds run concurrently one fails as so:
> Failed to load cache entry 0801251eccdf893889c1065191e1327d for task ':admin-api:findDeclaredProcsMain': Could not load from local cache: Timeout waiting to lock Build cache (/home/worker/.gradle/caches/build-cache-1). It is currently in use by another process.
Owner PID: 52
Our PID: 53
Owner Operation:
Our operation:
Lock file: /home/worker/.gradle/caches/build-cache-1/build-cache-1.lock
Looks like it's a 30 second timeout.
Is this a sign that sharing that directory is a bad idea? Or that Gradle is being too aggressive with the lock (could it take and release it much more frequently during concurrent builds, I wonder)?Rui Li
10/17/2025, 3:23 AMjava.lang.NoSuchMethodError: 'org.slf4j.spi.LoggingEventBuilder org.slf4j.Logger.atInfo()'
on running test, because Gradle automatically adds gradle-api.jar in the class path, and the jar file contains an older version of slf4j API that doesn't have these methods. Is there a way to exclude gradle-api.jar from the class path? The normal way of excluding transient dependency doesn't work, because nothing depends on gradle-api.jar except gradle itself.Edwin Jakobs
10/17/2025, 8:11 AMMaksym Moroz
10/17/2025, 9:58 AMbuild-logic
included build I use for convention plugins, the type you apply to gradle projects to unify declarations like android { }
In my gradle scan I get this message
The build cache configuration of the root build differs from the build cache configuration of the early evaluated ':build-logic' included build. It is recommended to keep them consistent, see here.
From what I could look up this is due to the fact I compose my included build inside pluginManagement { }
instead of directly on the settings.gradle.kts
itself
I guess I have a few questions:
1. Can I include my build-logic
outside of pluginManagement { }
?
2. Alternatively I could copy over buildCache configuration to the build-logic
?
What's the right approach? Is using pluginManagement includeBuild() a specific case that should be used only in some situations? Like providing a plugin that targets the settings.gradle.kts
itself?yjxf vf
10/17/2025, 2:48 PMincludeBuild('../A') {
dependencySubstitution {
substitute module('me.myname:a') using project(':')
}
}
gradle will awayls use jar task's outputDaren Burke
10/17/2025, 3:22 PMimplementation "com.my-company:my-project:my-version:spec"
I haven't been able to find a way to declare the ':spec' specific jar within the confines of the version catalog -- any ideas?Kanstantsin Shautsou
10/17/2025, 5:38 PMMaksym Moroz
10/17/2025, 6:00 PMcompileOnly
(I think my idea was mainly leaving root module plugins { }
as a single source of truth for putting plugins on classpath
This approach seemed to work just fine until I decided to lift gcp build cache plugin out of settings.gradle.kts
Now all of the sudden my android library convention plugin fails to resolve classes like com.android.lint
How do I make sense of this and what’s the solution?
My current intuition is that gcp build cache plugin being applied to settings was maybe putting com.android.library on classpath?
Also if I decide to use implementation configuration for convention plugin dependencies does it mean I will need drop root module plugins with apply false and instead have versionless plugins in my build files?Caleb Cushing
10/17/2025, 9:34 PM