From 3bdbdbdd534d170b586dad8012775fc94149e490 Mon Sep 17 00:00:00 2001 From: MohitMaliFtechiz Date: Thu, 6 Jun 2024 18:06:27 +0530 Subject: [PATCH] Fixed: The CD is failing because the new gradle version gives an error for the lib:generateMetadataFileForReleasePublication task. * The issue occurred because `generateMetadataFileForReleasePublication` uses the output of the `androidSourcesJar` task, but no dependency was declared on this task. This can lead to incorrect results being produced due to the tasks executing in the wrong order. To fix this, we added an explicit dependency on the `GenerateModuleMetadata` tasks, ensuring that all `GenerateModuleMetadata` tasks run after the `androidSourcesJar` task. --- lib/publish.gradle | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/publish.gradle b/lib/publish.gradle index c0487e2..fd2904d 100644 --- a/lib/publish.gradle +++ b/lib/publish.gradle @@ -71,6 +71,13 @@ afterEvaluate { } } } + + // Set dependency for the metadata file generation task + tasks.withType(GenerateModuleMetadata).tap { + configureEach { + dependsOn tasks.named("androidSourcesJar") + } + } } signing {