

I am planning to migrate to android-gradle-plugin-3.0.0 in main branch of work project but don't want to get into situation when I couldn't do release from main branch.

In the meantime, I have pending change that will output a warning when we detect composite builds so that we can warn developers that this is currently not working. Do you build apk from command line or studio I can't reproduce this in any case but would love to know conditions when this happens. I've passed along to them that I'm seeing more and more devs complaing about it, so I hope they'll fix it soon. This is something they intend to fix at some point (too late for 4.2 though as it's in RC already). (The case where the included build is a plugin 2.x means that the generated build artifact from library does not include variant information and is just an AAR, so the new plugin consumes this as an external dependency and it should work.)

We define custom attributes for variant aware dependency resolution, but because the included builds are in a different classloader, Gradle considers the attribute on the consumer and the producer to be different. The issue isn't in our plugin but Gradle itself. If both sides (parent and included build) uses the Android plugin 3.0 then it will not work. If the included build includes android library modules being built with 2.x it should work as well (though I haven't verified it). If the included build includes only java/java-library modules it should work. Composite builds will not be fixed in 3.0, at least in most cases.
