I have a strange issue with INSTALL_FAILED_DEXOPT . This occurs in android 5.0 devices in emulator as well as in devices. And strange thing is that it works well when build variant in Debug mode .
If I change to Release I get this exception only on 5.0 devices. I have thoroughly went through all the links that is available in google.
Wipe the data
Bought a new device where I can install for the first time but still I face the same issue.
Project has multidex support:- true in gradle
Also tried change SDK tool version and build tool version to latest which is 24.4.0.
I use this device
When i build in release mode i get this Error
in Console
These are the build type we use.
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
signingConfig signingConfigs.debug
}
}
Image of SDK Tools used:
I can assure you that there has been never a build installed the device.I have cleared everything if it already installed.
Can somebody in this world could help me with this issue.Because it driving us crazy.....
When the APK is installed onto Android, the OS executes dex2opt
for optimizing. The INSTALL_FAILED_DEXOPT
error message means that your device can't optimize the dex file.
This issue usually occurs because of the dex file size. Usually, you can find a LinearAlloc Limit
warning or error message in the Android monitor when this happens. If it is a problem of dex size, add this to your build.gradle
file:
afterEvaluate {
tasks.matching {
it.name.startsWith('dex')
}.each { dx ->
if (dx.additionalParameters == null) {
dx.additionalParameters = []
}
// To avoid linearAlloc limit problem on Gingerbread and below
dx.additionalParameters += "--set-max-idx-number=50000"
dx.additionalParameters += "--minimal-main-dex"
}
}
Also, be sure to turn Instant Run off.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With