The device might have stale dexed jars that don't match the current version (dexopt error)

Viewed 984

I m facing this problem when trying to simulate program on Nexus 7 API 21. Working fine on other mobile emulator.

10/28 14:38:22: Launching 'app' on Nexus 7 (2012) API 21. Installation did not succeed. The application could not be installed: INSTALL_FAILED_DEXOPT The device might have stale dexed jars that don't match the current version (dexopt error).

My build gradle is :

 apply plugin: 'com.android.application'

   android {
   compileSdkVersion 29
   buildToolsVersion "29.0.1"
   defaultConfig {
   applicationId "test.taha.interactiveguitesting"
    minSdkVersion 15
    targetSdkVersion 29
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
1 Answers

Add in gradle.properties

android.enableD8=false
android.enableD8.desugaring=false
Related