Skip to content

Instantly share code, notes, and snippets.

@xujiaao
Last active June 8, 2020 12:45
Show Gist options
  • Save xujiaao/8e6ef5a00fb00b8b59d9fa898674acc4 to your computer and use it in GitHub Desktop.
Save xujiaao/8e6ef5a00fb00b8b59d9fa898674acc4 to your computer and use it in GitHub Desktop.
[INSTALL_FAILED_DEXOPT] Error on Android 5.1
tags
Android

[INSTALL_FAILED_DEXOPT] Error on Android 5.1

In these days, I have updated Android Gradle Plugin from v3.0.1 to v3.1.2, and got this issule when installing the apk file on Android 5.1 devices:

> Failure [INSTALL_FAILED_DEXOPT]

Then, after changing the Android Gradle Plugin to v3.1.3, the installtion is successful...


I guess it is a bug of Android Gradle Plugin v3.1.2 with D8:

New DEX compiler, D8

By default, Android Studio now uses a new DEX compiler called D8. DEX compilation is the process of transforming .class bytecode into .dex bytecode for the Android Runtime (or Dalvik, for older versions of Android). Compared to the previous compiler, called DX, D8 compiles faster and outputs smaller DEX files, all while having the same or better app runtime performance.

D8 shouldn't change your day-to-day app development workflow. However, if you experience any issues related to the new compiler, please report a bug. You can temporarily disable D8 and use DX by including the following in your project's gradle.properties file:

android.enableD8=false

See: https://developer.android.com/studio/releases/gradle-plugin

To prove it, I rolled back the Android Gradle Plugin to v3.1.2 and added android.enableD8=false, it works too...

@grishatop1
Copy link

Yes, that fixed my problem but now I can't use Firebase...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment