title: Use different build types of Library Module in Android App Module in Android Studio and Gradle
body: <p>I have a workspace containing several different apps and a common library project that I am looking to convert from Eclipse to Android Studio and from Ant to Gradle.  Currently, in our ant scripts we replace text in a few of our classes before compiling depending on if the build is for debug purposes, QA, Beta/Customer Acceptance testing or meant for release to Google Play.</p>
  
  <p>I want to take advantage of the build variant system in Gradle and use value resources (booleans, strings, etc) to keep from having the build script replace text in my classes.</p>
  
  <p>Since duplicating the different values for all of the build types in all of my app products would be a maintenance headache, I want to put them in the build types in my common library.  I tried this but no matter which build type I use in my app modules, the app module pulls in the Release build of the common library module.</p>
  
  <p>Is there any way that I can get the different build types of the app modules to use the corresponding build type of the library module?</p>
  
  <p>This was run from Android Studio with the Build Variants tool window showing both modules as using the debug variant.  The image should read debug for both app and library.</p>
  
  <p><img src="https://i.imgur.com/gCZG9OT.png" alt="debug debug"></p>