title: java.lang.VerifyError with API < 21
body: <p>I'm using <code>MultiDex</code> in my app to support over 65k methods. Over api 21 it works well because it does a predex build. Under api 21 I have a crash in my <code>Application</code> with this stacktrace:</p>
  
  <pre><code>java.lang.VerifyError: mypackage/com/myapp/MyAppApplication
              at java.lang.Class.newInstanceImpl(Native Method)
              at java.lang.Class.newInstance(Class.java:1215)
              at android.app.Instrumentation.newApplication(Instrumentation.java:990)
              at android.app.Instrumentation.newApplication(Instrumentation.java:975)
              at android.app.LoadedApk.makeApplication(LoadedApk.java:502)
              at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4537)
              at android.app.ActivityThread.access$1500(ActivityThread.java:151)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1402)
              at android.os.Handler.dispatchMessage(Handler.java:110)
              at android.os.Looper.loop(Looper.java:193)
              at android.app.ActivityThread.main(ActivityThread.java:5322)
              at java.lang.reflect.Method.invokeNative(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:515)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
              at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>This is my <code>gradle</code> file (simplified) with different flavors for compiling with predex in debug:</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 22
      buildToolsVersion "22.0.1"
  
      defaultConfig {
          applicationId "mypackage.com.myapp"
          targetSdkVersion 22
          versionCode Integer.parseInt(new Date().format("yyMMddHH"))
          versionName "1.0"
          multiDexEnabled = true
      }
  
      productFlavors {
          normal {
              minSdkVersion 21
          }
  
          beta {
              minSdkVersion 16
              versionName "1.0.0_beta"
          }
  
          prod {
              minSdkVersion 16
          }
      }
  
      dexOptions {
          javaMaxHeapSize "4g"
      }
  
      buildTypes {
          debug {
              minifyEnabled false
              debuggable true
          }
          release {
              minifyEnabled true
              shrinkResources true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:multidex:1.0.0'
  }
  </code></pre>
  
  <p>And this is my <code>Application</code>:</p>
  
  <pre><code>public class MyApplication extends CustomLibraryApplication {
      @Override
      protected void attachBaseContext(Context base) {
          super.attachBaseContext(base);
          MultiDex.install(this);
      }
  }
  </code></pre>
  
  <p>And in my manifest under <code>&lt;application&gt;</code> i have <code>android:name=".MyApplication"</code></p>
  
  <p>Solutions like: "exclude some of google play services" or "extend MultiDexApplication" are not useful in this case.</p>