title: What is the good strategy when dealing with Proguard, MultiDex, Testing and Product Flavors?
body: <p>I have an app that reference ~ 100K methods, with min Sdk = 16</p>
  
  <p>Here is 2 option for assembling:</p>
  
  <ul>
  <li>Proguard shrink this bunch of methods to only 44K methods</li>
  <li>Use Multi Dex</li>
  </ul>
  
  <p>Now I have some common use cases:</p>
  
  <ol>
  <li>Run and debug on emulator and devices
  
  <ul>
  <li>It requires to be as fast as possible</li>
  </ul></li>
  <li>Do tests (Integration and UI)
  
  <ul>
  <li>It requires to run (I have some issue running Espresso with MultiDex)</li>
  </ul></li>
  <li>Make the Prod APK
  
  <ul>
  <li>It requires to be reliable and shrinked as possible</li>
  </ul></li>
  </ol>
  
  <p><strong>Do you have guys some recommandation about the assembling strategy ?</strong></p>
  
  <p><strong>3/ Prod</strong></p>
  
  <ul>
  <li>Use Proguard to reduce APK size</li>
  <li>Use Proguard to obfuscate</li>
  <li>Do not use Multidex as most as possible (it may failed)</li>
  </ul>
  
  <p><strong>2/ Test</strong></p>
  
  <ul>
  <li>Use minSdkVersion 21 (I read that starting by 21 enable pre-dexing, that saves time)</li>
  <li>???</li>
  </ul>
  
  <p><strong>1/ Debug</strong></p>
  
  <ul>
  <li>Use minSdkVersion 21 (I read that starting by 21 enable pre-dexing, that saves time)</li>
  <li>???</li>
  </ul>
  
  <p>Here is the Gradle file :</p>
  
  <pre><code>    productFlavors {
          dev {
              minSdkVersion 21
              multiDexEnabled ???
              testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          }
          prod {
              // The actual minSdkVersion for the application.
              minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
              multiDexEnabled false
          }
      }
      defaultConfig {
          applicationId "xxxx"
          targetSdkVersion ANDROID_BUILD_TARGET_SDK_VERSION
          minSdkVersion ANDROID_BUILD_MIN_SDK_VERSION
          versionCode ANDROID_BUILD_VERSION_CODE
          versionName ANDROID_BUILD_APP_VERSION_NAME
      }
  
      buildTypes {
          release {
              debuggable false
              ext.enableCrashlytics = true
              renderscriptOptimLevel 3
              signingConfig android.signingConfigs.release
              zipAlignEnabled true
              minifyEnabled true
              //  shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
          }
          debug {
              debuggable true
              renderscriptOptimLevel 3
              applicationIdSuffix ".debug"
              versionNameSuffix "debug"
              minifyEnabled false
          }
      }
  </code></pre>