DefaultPublishConfiguration: for some reason, in AGP >= 4.2, Configuration.getAllArtifacts() returns duplicates where classifier is null. This causes publishing to break as it doesn't allow multiple artifacts with the same (extension, classifier)-tuple for one publication. To fix this, we filter out these null-classifier artifacts from DefaultPublishConfiguration.getArtifacts().
VariantPublishConfiguration: it looks like the archive task that assemble depends on for AGP >= 4.2 is no longer a plain Task-object, but rather, a wrapper (of type org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultRegularFileVar) that lazily produces the task when needed. This causes publishing to break as we currently assume that the archiving that assemble depends on is a pure Zip-task. To fix this, we account for possibility of the archiving task being of the wrapper type as well.
These were the compatibility issues:
DefaultPublishConfiguration
: for some reason, in AGP >= 4.2,Configuration.getAllArtifacts()
returns duplicates where classifier is null. This causes publishing to break as it doesn't allow multiple artifacts with the same (extension, classifier)-tuple for one publication. To fix this, we filter out these null-classifier artifacts fromDefaultPublishConfiguration.getArtifacts()
.VariantPublishConfiguration
: it looks like the archive task that assemble depends on for AGP >= 4.2 is no longer a plainTask
-object, but rather, a wrapper (of typeorg.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultRegularFileVar
) that lazily produces the task when needed. This causes publishing to break as we currently assume that the archiving that assemble depends on is a pureZip
-task. To fix this, we account for possibility of the archiving task being of the wrapper type as well.