Tomáš Procházka
06/14/2024, 8:30 PMExecution failed for task ':app:hiltAggregateDepsDefaulBackendTest'.
> Could not resolve all files for configuration ':app:defaultBackendTestRuntimeClasspath'.
> Failed to transform protobuf-java-3.21.12-lite.jar (com.google.protobuf:protobuf-java:3.21.12) to match attributes {artifactType=aggregated-jar-for-hilt, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
> Could not find protobuf-java-3.21.12-lite.jar (com.google.protobuf:protobuf-java:3.21.12).
Searched in the following locations:
<https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12-lite.jar>
And it makes no sense, there is -lite classifier, there is nothing like that in reality, the right path is
<https://repo.maven.apache.org/maven2/com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12.jar>
How to found source of that classifier definition please?
Gradle has generally very bad support for maven classifiers
gradlew dependencies will not print it.
It is even not possible to exclude it.Thomas Broyer
06/14/2024, 8:51 PMgradlew :app:dependencyInsight --configuration hiltAggregateDepsDefaultBackendTest --dependency protobuf-java ? (maybe try with another configuration too)Tomáš Procházka
06/14/2024, 9:27 PMRuntimeClasspath and CompileClasspath
Now I tried the full task name as you suggest ant it also ends up with
`configuration `hiltAggregateDepsDefaultBackendTest`' not found in configuration container.`Tomáš Procházka
06/14/2024, 9:30 PMThomas Broyer
06/14/2024, 9:30 PM--configuration defaultBackendTestRuntimeClasspath (as printed in the error message)Tomáš Procházka
06/14/2024, 9:32 PMTomáš Procházka
06/14/2024, 9:33 PMThomas Broyer
06/14/2024, 9:41 PMgradlew :app:dependencies (note the :app prefix here, just in case) then try the :app:dependencyInsight with the configuration.
Or you could run gradlew :app:dependencies redirecting the output to a file, then search for protobuf-java in that file; that should tell you (like dependencyInsight, but with fewer details) where protobuf-java comes from, and possibly changes in versions between the declared one (that could have had a lite variant) and selected one (that no longer has).
And to fix that, Gradle gives you many many tools, e.g. module metadata rules so you can remove the lite classifier from the declared dependency for the module that depends on protobuf-java with that classifier (classifiers are a half-thought-out Maven solution to "variants", a thing of the past –or specifically for Maven that has no other means of expressing such things–, where Gradle has true variant support).Tomáš Procházka
06/14/2024, 9:52 PMandroidJdkImage - Configuration providing JDK image for compiling Java 9+ sources
No dependencies
androidTestAnnotationProcessor - Classpath for the annotation processor for 'androidTest'. (n)
No dependencies
androidTestApi (n)
No dependencies
androidTestApiDependenciesMetadata
No dependencies
androidTestAvastAnnotationProcessor - Classpath for the annotation processor for 'androidTestAvast'. (n)
No dependencies
androidTestAvastApi (n)
No dependencies
And even many with real tree like
androidTestImplementationDependenciesMetadata
+--- androidx.compose.ui:ui-test-junit4 -> 1.5.4
| +--- androidx.compose.ui:ui-test:1.5.4
| | +--- androidx.compose.runtime:runtime:1.5.4
| | | \--- androidx.compose.runtime:runtime-saveable:1.5.4 (c)
| | +--- androidx.compose.ui:ui:1.5.4
| | | +--- androidx.compose.runtime:runtime-saveable:1.5.4
| | | | +--- androidx.compose.runtime:runtime:1.5.4 (*)
| | | | \--- androidx.compose.runtime:runtime:1.5.4 (c)
But nothing works in
* What went wrong:
configuration 'androidTestImplementationDependenciesMetadata' not found in configuration container.Tomáš Procházka
06/14/2024, 9:54 PMgradlew app:dependencies would simply print that 😞Tomáš Procházka
06/14/2024, 9:55 PM