I have built a pure java library, and have compiled two versions, one shadowed (using the gradle shadow plugin), one not, and deployed them to my local nexus repository.
In my Android Library project, I've created two productFlavors, standard and shadowed, that reference the respective artifacts in my nexus repository. In Android Studio, only the standard product flavor with the non-shadowed jar shows the libraries in the External Libraries.
Switching to any of the shadowed build variants results in the dependencies missing completely in Android Studio, and all the code referencing either of them appears to be broken in AS. (Have to sync gradle when switching build variants for the dependencies to change).
Other dependencies added to the shadowed compile configuration, such as firebase, show up and work just fine. So it's just this one dependency. Nothing unusual is printed in the gradle console or the event log.
However, gradle from the command line is a totally different story. Running ./gradlew library:dependencies shows the libraries and their dependencies appropriately, and I can compile and build my AARs for all the variants from the command line without issues. It worked when the android library was a sub-project of my larger project, but since I broke it out into a separate project in Android Studio, it looks like it doesn't work at all anymore.
The build.gradle looks like this (normal stuff excluded):
android {
publishNonDefault true
productFlavors {
standard {}
shadowed {}
}
}
dependencies {
standardCompile 'groupId:core:1.0.0-SNAPSHOT'
shadowedCompile 'groupId:core-shadowed:1.0.0-SNAPSHOT'
}
FWIW, This is using:
Android Studio 2.3.3 Build #AI-162.4069837, built on June 6, 2017
JRE: 1.8.0_92-b14 x86_64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
Gradle Plugin: 2.3.3
Gradle: 3.5
Build Tools: 25.0.3
The only thing that I've really been able to determine that's different between the two (besides relocated packages and different set of dependencies in the pom) is the contents of the META-INF folder of the shadowed jar - I wonder if this could be confusing AS? In particular the shadow plugin adds a Class-Path entry in the MANIFEST.MF listing the runtime dependency jar files that were excluded from the fat jar, as well as a META-INF/maven/ folder containing entries with the .pom's for each of those as well.