tony
10/03/2026, 8:55 PMconfigurations.named() instead of configurations.getByName(), and ran into an issue that ultimately looks like this:
- Task `:lib:findNativeLibsDebug` of type `com.autonomousapps.tasks.FindNativeLibsTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.result.DefaultResolvedArtifactResult', a subtype of 'org.gradle.api.artifacts.result.ArtifactResult', as these are not supported with the configuration cache.
See <https://docs.gradle.org/8.11.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
I experimented and I no longer get that issue from Gradle 9.5.0. I'm looking at the release notes for that release, and there's nothing obviously related to this issue. The nearest thing I can see is https://github.com/gradle/gradle/issues/35318. What am I missing? Is my code only working in newer releases by accident?
I think this is from this in my task:
@get:Internal
public abstract val androidJni: SetProperty<ResolvedArtifactResult>
@Optional // Only available on Android
@PathSensitive(PathSensitivity.RELATIVE)
@InputFiles
public fun getAndroidJniFiles(): Provider<List<File>>? {
if (!androidJni.isPresent) return null
return androidJni.map { artifactResults -> artifactResults.map { it.file } }
}
@Input
public fun getAndroidJniIdentifiers(): Provider<List<String>> = androidJni.identifiers()Philip W
10/03/2026, 9:04 PMtony
10/04/2026, 6:46 PM(Default)ResolvedArtifactResult can't be a CC inputPhilip W
10/04/2026, 6:54 PMtony
10/04/2026, 8:06 PMProvider.zip to reattach the artifact metadata to the files. That's such an annoying thing to have to do. I guess it's fixed in 9.5.0? But again, I don't see it in the release notes 😔tony
10/05/2026, 6:12 PM> Cannot fingerprint input property 'androidJniDetails': value '[ArtifactDetails(id=graphics-core-1.0.2.aar -> jni (androidx.graphics:graphics-core:1.0.2), variant=androidx.graphics:graphics-core:1.0.2 variant releaseVariantReleaseApiPublication)]' cannot be serialized.tony
10/05/2026, 6:13 PM@Nested
public data class ArtifactDetails(
@get:Input val id: ComponentArtifactIdentifier,
@get:Input val variant: ResolvedVariantResult,
)
Gradle docs considered harmfulMikhail Lopatkin
10/05/2026, 6:27 PMResolvedArtifactResult is one of them (maybe except one or two very rare subtypes).tony
10/08/2026, 1:32 AM* What went wrong:
A problem was found with the configuration of task ':lib_android:artifactsReportDebug' (type 'ArtifactsReportTask').
Property has implicit dependency
Gradle detected a problem with the following location: '.../dependency-analysis-gradle-plugin/build/functionalTest/AdviceFilterProject-665aa936-10/java-annotations/build/classes/java/main'
Task ':lib_android:artifactsReportDebug' uses this output of task ':java-annotations:compileJava' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed
I've gone from this (in my task definition):
private lateinit var classpath: ArtifactCollection
public fun setClasspath(artifacts: ArtifactCollection) {
this.classpath = artifacts
classpathIdentifiers.set(artifacts.identifiers())
}
@Classpath
public fun getClasspath(): FileCollection = classpath.artifactFiles
@get:Input
public abstract val classpathIdentifiers: ListProperty<String>
to this:
@get:Nested
public abstract val classpathDetails: ListProperty<ArtifactDetails>
@get:Classpath
public abstract val classpathFiles: ListProperty<File>
internal fun withClasspath(artifacts: Provider<Set<ResolvedArtifactResult>>) {
classpathDetails.set(ArtifactDetails.of(artifacts))
classpathFiles.set(ArtifactDetails.files(artifacts))
}
and the latter is what's recommended in the gradle docs. `ArtifactDetails`:
public data class ArtifactDetails(
@get:Input val id: ComponentArtifactIdentifier,
@get:Input val variant: ResolvedVariantResult,
) {
internal companion object {
fun of(artifacts: Provider<Set<ResolvedArtifactResult>>): Provider<List<ArtifactDetails>> {
return artifacts.map { it.map { artifact -> ArtifactDetails(artifact.id, artifact.variant) } }
}
fun files(artifacts: Provider<Set<ResolvedArtifactResult>>): Provider<List<File>> {
return artifacts.map { it.map { artifact -> artifact.file } }
}
}
}tony
10/08/2026, 1:35 AM--info or --debug show relevant information?tony
10/08/2026, 5:45 PMtony
10/08/2026, 6:05 PMtony
10/08/2026, 6:06 PMartifactsReport task. It was a different task, and now somehow I've lost attribution in this tasktony
10/08/2026, 6:08 PMtony
10/09/2026, 12:40 AM@Nested inputs built from providers. I'm going to remove all these nested inputs