Error [INSTALL_FAILED_DEXOPT] in Android 5.1

1

Before explaining why i had to post this question, let me explain that i have already gone trough most of the other answers in the list to no avail.

The issue I am getting during installation of the APK (via adb.exe on a real device) is [INSTALL_FAILED_DEXOPT] with the following output from LogCat:

INFO:

PackageManager(  725): init_copy idx=0: InstallParams{1d0ac875 file=/data/local/tmp/PruebaMapas.apk cid=null}
PackageManager(  725): Trying to bind to DefaultContainerService
PackageManager(  725): onServiceConnected
PackageManager(  725): onServiceConnected: true, 0
PackageManager(  725): mcs_bound
PackageManager(  725): startCopy UserHandle{-1}: InstallParams{1d0ac875 file=/data/local/tmp/PruebaMapas.apk cid=null}
PackageManager(  725): Apk copy done
PackageManager(  725): Checking for more work or unbind...
PackageManager(  725): Posting delayed MCS_UNBIND
PackageManager(  725): Start parsing apk: null
PackageManager(  725): Parsing done for apk: null
PackageManager(  725): Start installation for package: null
PackageManager(  725): Linking native library dir for /data/app/com.actividad.PruebaMapas-1
PackageManager(  725): Perform pre-dex opt for package: com.actividad.PruebaMapas
PackageManager(  725): Running dexopt on: /data/app/com.actividad.PruebaMapas-1/base.apk pkg=com.actividad.PruebaMapas isa=arm vmSafeMode=false
PackageManager(  725): Dexopt done on: com.actividad.PruebaMapas
PackageManager(  725): Installation done for package: null
PackageManager(  725): mcs_check
PackageManager(  725): mcs_check(true, 1)
PackageManager(  725): disconnectService: false
PackageManager(  725): mcs_unbind
PackageManager(  725): calling disconnectService()

ERROR:

PlayCommon( 9265): [745] com.google.android.play.b.h.a(553): Failed to connect to server: java.net.UnknownHostException: Unable to resolve host "play.googleapis.com": No address associated with hostname
AEE/AED (24646): AM write failure (32 / Broken pipe)
AEE/AED (24646): timed out waiting for tid=24637 to stop
AEE/AED (24646): timed out waiting for tid=24638 to stop
AEE/AED (24646): timed out waiting for tid=24639 to stop
AEE/LIBAEE(24646): aee_try_get_word: read:24640 addr:0x00000006 ret:-1, 5
AEE/AED (24646): timed out waiting for tid=24640 to stop
installd(  224): DexInv: --- END '/data/app/com.actividad.PruebaMapas-1/base.apk' --- status=0x0006, process failed

The problem dissapears if i remove support for Google Maps V2 and references to android.support.v4.*, but since i obviously need it, just removing it is not an option.

I already reduced dependencies to make the generated APK (the classes.dex, that is, because the app compiles to 2.3MB) smaller than 5MB.

I already implemented multi dexing, to make each .dex much smaller than 5MB.

The application installs and works perfectly fine in an older device running Android 4.4. As well as many other devices running various OS versions.

This leads me to think that, since I am testing this on a Finow X5 Air Smartwatch that im not sure it is really 5.1, it might be older and state that it is 5.1?? I dont know, its a chinese watch, so all bets are off. (Update: The Smartwatch OS is not to blame, it is a genuine 5.1 OS, although the quality of the watch is awful.)

I am not using Gradle or Android studio. I am using my own compiler that i am developing, so, i am compiling the app with commandline. But the source code is in Java and it is not any different than the code used in Android Studio.

Anything else that i need to state to get help, i will. Thanks.

EDIT: I added more logcat info.

android
maps
asked on Stack Overflow May 21, 2018 by Brian • edited Jun 18, 2018 by Brian

1 Answer

1

I have the same issue when using Android Gradle Plugin 3.1.2.

After updating the verion to 3.1.3, this issue disappears:

dependencies {
    classpath 'com.android.tools.build:gradle:3.1.3'
}

I guess it is an issule of 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#D8


Also, I tried Android Gradle Plugin 3.1.2 + android.enableD8=false, it works too...

answered on Stack Overflow Jun 15, 2018 by Real.Xu • edited Jun 15, 2018 by Real.Xu

User contributions licensed under CC BY-SA 3.0