title: Error:Unexpected type tag 13996 found. or Enable Multidex for Apps with Over 64K Methods
body: <p>I got the </p>
  
  <h2><strong>Enable Multidex for Apps with Over 64K Methods</strong></h2>
  
  <p>error. I search it and the solution is here: <a href="https://developer.android.com/studio/build/multidex.html" rel="nofollow noreferrer">https://developer.android.com/studio/build/multidex.html</a></p>
  
  <p>When I apply the solution that told by android it self, I get another error :  </p>
  
  <h2><strong>Error:Unexpected type tag 13996 found.</strong></h2>
  
  <p><strong><em>What should I do?</em></strong></p>
  
  <p><strong>For more details:</strong>
   Web side: <a href="https://developer.android.com/studio/build/multidex.html" rel="nofollow noreferrer">https://developer.android.com/studio/build/multidex.html</a>
   basically says that add  <strong>multiDexEnabled true</strong> to defaultConfig of <strong>app level build gradle</strong> and add <strong>compile 'com.android.support:multidex:1.0.1'</strong> to dependencies.</p>
  
  <pre><code>android {
      defaultConfig {
          ...
          multiDexEnabled true
      }
      ...
  }
  
  dependencies {
    compile 'com.android.support:multidex:1.0.1'
  }
  </code></pre>
  
  <p>And according the below article I need to extend my application class from
   <strong>MultiDexApplication</strong> like this</p>
  
  <blockquote>
    <p>if you do override the Application class, change it to extend
    MultiDexApplication (if possible) as follows: public class
    MyApplication extends MultiDexApplication { ... }</p>
  </blockquote>
  
  <pre><code>import android.support.multidex.MultiDexApplication;
  
  import com.engly.learnenglish.app.util.model.VocabularyModel;
  import com.onesignal.OneSignal;
  
  import java.util.ArrayList;
  import java.util.List;
  
      public class App extends MultiDexApplication {
  
          private static App instance = null;
          private static List&lt;VocabularyModel&gt; vocabularyModelList;
  
          @Override
          public void onCreate() {
              super.onCreate();
              instance = this;
              vocabularyModelList = new ArrayList&lt;&gt;();
              OneSignal.startInit(this)
                      .inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
                      .unsubscribeWhenNotificationsAreDisabled(true)
                      .init();
          }
  
          public static App getInstance() {
              if (instance == null) {
                  instance = new App();
              }
              return instance;
          }
  
          public static List&lt;VocabularyModel&gt; getVocabularyModelList() {
              return vocabularyModelList;
          }
  
          public static void setVocabularyModelList(List&lt;VocabularyModel&gt; vocabularyModelList) {
              App.vocabularyModelList = vocabularyModelList;
          }
          public static void addVocabularyToList(VocabularyModel vocabularyModel){
              App.vocabularyModelList.add(vocabularyModel);
          }
  
      }
  </code></pre>
  
  <p>When I apply the solution I get this error</p>
  
  <pre><code>Error:Unexpected type tag 13996 found.
  </code></pre>
  
  <p><strong>This is my project level gradle</strong> </p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
          maven { url 'https://maven.fabric.io/public' }
      }
      dependencies {
          classpath 'io.fabric.tools:gradle:1.+'
          classpath 'com.android.tools.build:gradle:3.0.1'
          classpath 'com.google.gms:google-services:3.1.2'
          //in sake of butter knife
          classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
          maven {
              url "https://maven.google.com" // Google's Maven repository
          }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  ext {
      /*
      App version
       */
      versionCode = 8
      versionName = '2.0.0'
  
  
      /*
      SDK version
       */
      buildToolsVersion = '25.0.0'
      compileSdkVersion = 25
      minSdkVersion = 16
      targetSdkVersion = 25
  
      /*
      Dependency versions
       */
      supportLibVersion = '25.0.0'
      butterknifeVersion = '8.4.0'
      commonsioVersion = '2.5'
      appacheCommonsVersion = '3.4'
      googleGsonVersion = '2.7'
      relexCircleIndicatorVersion = '1.2.2@aar'
      viewpagerTransformsVersion = '1.2.32@aar'
      pageLoaderVersion = '0.0.2'
      topSnackbarVersion = '1.1.1'
      retrofit2Version = '2.0.2'
      picassoVersion = '2.5.2'
      recyclerTabLayoutVersion = '1.1.0'
      okhttpVersion = '2.4.0'
  
      /*
      Dependencies
       */
      supportLibAppCompat = "com.android.support:appcompat-v7:$supportLibVersion"
      supportLibDesign = "com.android.support:design:$supportLibVersion"
      supportLibRecyclerView = "com.android.support:recyclerview-v7:$supportLibVersion"
      supportLibPercentLayout = "com.android.support:percent:$supportLibVersion"
      supportLibCardView = "com.android.support:cardview-v7:$supportLibVersion"
      butterknife = "com.jakewharton:butterknife:$butterknifeVersion"
      butterknifeApt = "com.jakewharton:butterknife-compiler:$butterknifeVersion"
      commonsIo = "commons-io:commons-io:$commonsioVersion"
      appacheCommons = "org.apache.commons:commons-lang3:$appacheCommonsVersion"
      googleGson = "com.google.code.gson:gson:$googleGsonVersion"
      relexCircleIndicator = "me.relex:circleindicator:$relexCircleIndicatorVersion"
      picasso = "com.squareup.picasso:picasso:$picassoVersion"
      okhttp = "com.squareup.okhttp:okhttp:$okhttpVersion"
      retrofit2 = "com.squareup.retrofit2:retrofit:$retrofit2Version"
      retrofit2Converter = "com.squareup.retrofit2:converter-gson:$retrofit2Version"
      viewpagerTransforms = "com.ToxicBakery.viewpager.transforms:view-pager-transforms:$viewpagerTransformsVersion"
      pageLoader = "id.arieridwan:pageloader:$pageLoaderVersion"
      topSnackbar = "com.androidadvance:topsnackbar:$topSnackbarVersion"
      recyclerTabLayout = "com.nshmura:recyclertablayout:$recyclerTabLayoutVersion"
  }
  </code></pre>
  
  <p><strong>This is my app level gradle</strong> </p>
  
  <pre><code>plugins {
      id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.0'
  }
  apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
  apply plugin: 'com.android.application'
  apply plugin: 'io.fabric'
  
  repositories {
      maven { url 'https://maven.google.com' }
      maven { url 'https://maven.fabric.io/public' }
  }
  apply plugin: 'com.android.application'
  
  android {
      dexOptions {
          jumboMode true
      }
      compileSdkVersion rootProject.ext.compileSdkVersion
      buildToolsVersion rootProject.ext.buildToolsVersion
      defaultConfig {
          manifestPlaceholders = [onesignal_app_id               : "2fe20af9-bdcf-49cd-bbfe-6ffd8f11f8c2",
                                  // Project number pulled from dashboard, local value is ignored.
                                  onesignal_google_project_number: "REMOTE"]
          applicationId 'com.engly.learnenglish.app'
          minSdkVersion rootProject.ext.minSdkVersion
          targetSdkVersion rootProject.ext.targetSdkVersion
          versionCode rootProject.ext.versionCode
          versionName rootProject.ext.versionName
          vectorDrawables {
              useSupportLibrary = true
          }
          generatedDensities = []
          multiDexEnabled true
      }
      lintOptions
              {
                  checkReleaseBuilds false
                  abortOnError false
  
              }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      aaptOptions {
          additionalParameters "--no-version-vectors"
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
      productFlavors {
      }
      buildToolsVersion '26.0.2'
  }
  
  dependencies {
      implementation 'com.google.firebase:firebase-messaging:11.8.0'
      compile fileTree(include: ['*.jar'], dir: 'libs')
      //support lib
      compile rootProject.ext.supportLibAppCompat
      compile rootProject.ext.supportLibPercentLayout
      compile rootProject.ext.supportLibRecyclerView
      compile rootProject.ext.supportLibCardView
      compile rootProject.ext.supportLibDesign
      //butterknife
      compile rootProject.ext.butterknife
      annotationProcessor rootProject.ext.butterknifeApt
      //commons
      compile rootProject.ext.commonsIo
      compile rootProject.ext.appacheCommons
      //gson
      compile rootProject.ext.googleGson
      //circle indicator
      compile rootProject.ext.relexCircleIndicator
      //piccasso
      compile rootProject.ext.picasso
      //retrofit
      compile rootProject.ext.okhttp
      compile rootProject.ext.retrofit2
      compile rootProject.ext.retrofit2Converter
      //recyclerview tablayout
      compile rootProject.ext.recyclerTabLayout
      //viewpager animation
      compile rootProject.ext.viewpagerTransforms
      //page loader
      compile rootProject.ext.pageLoader
      //top position snackbar
      compile rootProject.ext.topSnackbar
      implementation 'com.facebook.android:facebook-login:[4,5)'
      compile 'com.android.support:multidex:1.0.1'
      compile 'com.onesignal:OneSignal:[3.6.0, 3.99.99]'
      compile 'uk.co.chrisjenx:calligraphy:2.3.0'
      compile 'com.github.michaelye.easydialog:easydialog:1.4'
      compile 'com.hbb20:ccp:1.7.8'
      compile 'com.googlecode.libphonenumber:libphonenumber:8.4.2'
      compile 'com.google.android.exoplayer:exoplayer:r2.4.1'
      compile 'com.mikhaellopez:circularprogressbar:1.1.1'
      compile 'com.google.firebase:firebase-core:11.8.0'
      compile 'com.victor:lib:1.0.4'
      compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
          transitive = true
      }
      compile 'me.grantland:autofittextview:0.2.1'
      compile 'com.appsee:appsee-android:2.3.3'
      compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
      testCompile 'junit:junit:4.12'
  }
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p><strong>Full version gradle error from idea.log</strong></p>
  
  <pre><code>  com.intellij.openapi.externalSystem.model.ExternalSystemException: Unexpected type tag 13996 found.
      at com.android.tools.idea.gradle.project.sync.idea.ProjectImportErrorHandler.getUserFriendlyError(ProjectImportErrorHandler.java:85)
      at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:414)
      at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158)
      at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:906)
      at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:886)
      at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:218)
      at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:139)
      at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:79)
      at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.lambda$resolveProjectInfo$0(RemoteExternalSystemProjectResolverImpl.java:37)
      at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59)
      at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37)
      at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:45)
      at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:66)
      at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:139)
      at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:125)
      at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:388)
      at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$5.run(ExternalSystemUtil.java:445)
      at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
      at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:176)
      at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:556)
      at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
      at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
      at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
      at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:137)
      at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
  Caused by: java.lang.IllegalArgumentException: Unexpected type tag 13996 found.
      at org.gradle.internal.serialize.DefaultSerializerRegistry$TaggedTypeSerializer.read(DefaultSerializerRegistry.java:142)
      at org.gradle.internal.serialize.Serializers$StatefulSerializerAdapter$1.read(Serializers.java:36)
      at org.gradle.internal.remote.internal.inet.SocketConnection.receive(SocketConnection.java:79)
      at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:75)
      at org.gradle.launcher.daemon.client.DaemonClientConnection.receive(DaemonClientConnection.java:35)
      at org.gradle.launcher.daemon.client.DaemonClient.monitorBuild(DaemonClient.java:210)
      at org.gradle.launcher.daemon.client.DaemonClient.executeBuild(DaemonClient.java:178)
      at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:141)
      at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:92)
      at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:60)
      at org.gradle.tooling.internal.provider.DaemonBuildActionExecuter.execute(DaemonBuildActionExecuter.java:41)
      at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:60)
      at org.gradle.tooling.internal.provider.LoggingBridgingBuildActionExecuter.execute(LoggingBridgingBuildActionExecuter.java:34)
      at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:143)
      at org.gradle.tooling.internal.provider.ProviderConnection.run(ProviderConnection.java:128)
      at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:208)
      at org.gradle.tooling.internal.consumer.connection.CancellableConsumerConnection$CancellableActionRunner.run(CancellableConsumerConnection.java:99)
      at org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection.run(AbstractConsumerConnection.java:62)
      at org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection.run(ParameterValidatingConsumerConnection.java:53)
      at org.gradle.tooling.internal.consumer.DefaultBuildActionExecuter$1.run(DefaultBuildActionExecuter.java:71)
      at org.gradle.tooling.internal.consumer.connection.LazyConsumerActionExecutor.run(LazyConsumerActionExecutor.java:84)
      at org.gradle.tooling.internal.consumer.connection.CancellableConsumerActionExecutor.run(CancellableConsumerActionExecutor.java:45)
      at org.gradle.tooling.internal.consumer.connection.ProgressLoggingConsumerActionExecutor.run(ProgressLoggingConsumerActionExecutor.java:58)
      at org.gradle.tooling.internal.consumer.connection.RethrowingErrorsConsumerActionExecutor.run(RethrowingErrorsConsumerActionExecutor.java:38)
      at org.gradle.tooling.internal.consumer.async.DefaultAsyncConsumerActionExecutor$1$1.run(DefaultAsyncConsumerActionExecutor.java:55)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
      at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
  </code></pre>