installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error)
Asked Answered
H

8

34

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.

enter image description here

when I click on OK I get below error in log

Failure [INSTALL_FAILED_DEXOPT]
DEVICE SHELL COMMAND: pm uninstall my.package.name
Unknown failure

I got in this trouble after adding Google Cloud Module called "App Engine Backend with Google Cloud Messaging".

This is exactly same problem described in one of stack overflow questions here

I tried the accepted answer.

Ran dex-method-counts application I got "Overall method count: 24474" in terminal. I dont understand what to do next?

(Note : The same application is running on my other device running on kitkat.)

Please help to resolve this issue. I am struggling from past two days. I know there are many similar questions but nothing helped me.

Built--> Clean is not working.

Here is my build.gradle file

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'

}

Thanks in advance!

Henry answered 11/4, 2015 at 11:26 Comment(1)
S
33

This usually happens because your device doesn't have enough space in memory.

Delete some apps and try again

Ser answered 7/8, 2015 at 4:22 Comment(1)
For me, I just restarted my device.Janicejanicki
C
19

When i got this error, i was using a Nexus 4 in the AVD-Manager. By default this device was created with 500MB internal storage. I increased the storage to 2048MB and the "stale dexed" error was gone.

To increase the internal Storage:

  1. Go to ADV-Manager
  2. Select the Edit Button of the corresponding device under "Actions"
  3. Click "Show Advanced Settings"
  4. Increase your internal Storage
Caviar answered 10/10, 2019 at 3:23 Comment(0)
T
8

In case it's an Android Emulator giving you a "stale dexed" message, this helped for me on a Mac:

  1. stop emulator
  2. cd ~/.android/avd/[emulator name].avd
  3. rm *.lock
  4. wipe emulator
  5. start emulator
Trilingual answered 14/6, 2019 at 16:52 Comment(0)
L
7

I solved this by Wiping data .

Android Studio -> AVD Manager -> Actions -> Wipe Data

Linton answered 17/10, 2019 at 12:42 Comment(1)
thanks, easiest and fastest way to solve the problem. I encountered this when creating AVD's, but used duplicate so I had an API mismatch with the system files of another API.Hesper
R
4

It seems like your emulator low on disk space. But after you increase your disk space you still get error.

I faced the same problem, increase disk space and do factory reset for the emulator worked as well for me. To reset your emulator go to Settings -> Backup and Restore inside the emulator then reset.

Rothrock answered 19/6, 2020 at 2:19 Comment(0)
S
2

Disable Instant Run.

Android Studio -> Preferences -> Instant Run

Send answered 5/2, 2016 at 17:53 Comment(0)
C
0

Also I have the same problem. To make it work I had to remove "third party library" from dependencies. Or try this: https://developer.android.com/tools/building/multidex.html

Cherida answered 5/6, 2015 at 13:45 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.Disloyalty
D
0

Replace this 'compile files('libs/libGoogleAnalyticsServices.jar')' with this 'com.google.android.gms:play-services-analytics:8.3.0'

Donetta answered 19/11, 2015 at 14:50 Comment(1)
This should be a comment, not an answerArgyll

© 2022 - 2024 — McMap. All rights reserved.