How can Variant Outputs be manipulated using the Android Gradle Plugin 3.0.0+?

Viewed 3495

The latest version (3.0.0) of the Android Plugin for Gradle has broken its API for manipulating Variant Outputs. This API was used for manipulating files creating during builds (such as AndroidManifest.xml), and has been removed to improve configuration times.

What new APIs are available to manipulate Variant Outputs, and how do they differ to the 2.X APIs?

2 Answers

Looks like they've changed this interface again. (android gradle plugin 3.3+ or Gradle 5.4+)

I'm using the following to retrieve the manifestPath:

def manifestPath = "${manifestOutputDirectory.get().asFile}/AndroidManifest.xml"

Figured it out from here

Was getting a java.io.FileNotFoundException with the following in the path

property(interface org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, /Users/me/app/build/intermediates/merged_manifests/debug))
Related