title: installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error)
body: <p>I am unable to run app from android studio to my samsumg phone running android 2.3.6. I am getting Application installation Failed popup refer below screenshot.</p>
  
  <p><img src="https://i.stack.imgur.com/fm2Ta.png" alt="enter image description here"></p>
  
  <p>when I click on OK I get below error in log</p>
  
  <pre><code>Failure [INSTALL_FAILED_DEXOPT]
  DEVICE SHELL COMMAND: pm uninstall my.package.name
  Unknown failure
  </code></pre>
  
  <p>I got in this trouble after adding Google Cloud Module called "App Engine Backend with Google Cloud Messaging". </p>
  
  <p>This is exactly same problem described in one of stack overflow questions <a href="https://stackoverflow.com/questions/25493310/cant-upload-android-app-to-device-stale-dexed-jars">here</a></p>
  
  <p>I tried the accepted answer. </p>
  
  <p>Ran <strong>dex-method-counts</strong> application I got "Overall method count: 24474" in terminal. I dont understand what to do next? </p>
  
  <p>(Note : The same application is running on my other device running on kitkat.)</p>
  
  <p>Please help to resolve this issue. I am struggling from past two days. I know there are many similar questions but nothing helped me.</p>
  
  <p>Built--> Clean is not working.</p>
  
  <p>Here is my build.gradle file </p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 21
      buildToolsVersion "21.1.2"
  
      defaultConfig {
          applicationId "my.package.name"
          minSdkVersion 9
          targetSdkVersion 19
          compileOptions {
              sourceCompatibility JavaVersion.VERSION_1_7
              targetCompatibility JavaVersion.VERSION_1_7
          }
      }
  
      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  
  dependencies {
      compile files('libs/libGoogleAnalyticsServices.jar')
      compile project(path: ':gcmAppEngineBackend', configuration: 'android-endpoints')
      compile 'com.android.support:support-v4:22.0.0'
      compile 'com.android.support:appcompat-v7:22.0.0'
      compile 'com.google.android.gms:play-services:7.0.0'
  
  }
  </code></pre>
  
  <p>Thanks in advance!</p>