title: Error [INSTALL_FAILED_DEXOPT] in Android 5.1
body: <p>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.</p>
  
  <p>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:</p>
  
  <p>INFO:</p>
  
  <pre><code>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()
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>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.</p>
  
  <p>I already reduced dependencies to make the generated APK (the classes.dex, that is, because the app compiles to 2.3MB) smaller than 5MB.</p>
  
  <p>I already implemented multi dexing, to make each .dex much smaller than 5MB.</p>
  
  <p>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.</p>
  
  <p>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.)</p>
  
  <p>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.</p>
  
  <p>Anything else that i need to state to get help, i will. Thanks.</p>
  
  <p>EDIT:
  I added more logcat info.</p>