Because the plugin automatically matches dependencies for you, you should name your flavor dimensions carefully.Doing so gives you more control over which code and resources from your local dependencies are matched with each version of your app.

However, targeting a specific variant of a local module dependency (for example, using Error: Unable to resolve dependency for ':[email protected]/compile Classpath': Could not resolve project :library.

Error: Unable to resolve dependency for ':[email protected]/compile Classpath': Could not resolve project :library.

In order for the plugin to accurately match variants, you need to declare flavor dimensions for all product flavors and provide matching fallbacks for instances where a direct match is not possible.

The plugin now requires that all flavors belong to a named flavor dimension—even if you intend to use only a single dimension.

Consult the table below to determine which DSL property you should use to resolve certain build errors related to variant-aware dependency matching. For example, your app includes a "staging" build type, but a dependency includes only a "debug" and "release" build type.

Note that there is no issue when a library dependency includes a build type that your app does not.

DSL now needs to match the consumer in build type and flavors (and other attributes).

For instance, it is not possible to make a "debug" variant consume a "release" variant through this mechanism because the producer and consumer variants would not match.

That's because the plugin simply never requests that build type from the dependency.