Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failure [INSTALL_FAILED_DEXOPT]

When i upload my app in virtual device i have a problem, how fix it? Virtual device: Nexus S, CPU: Intel Atom x86. I am use Android Studio

Waiting for device.
Target device: emulator-5554
Uploading file
    local path: D:\git\Genius\app\build\apk\app-debug-unaligned.apk
    remote path: /data/local/tmp/com.vlad.genius.app
Installing com.vlad.genius.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.vlad.genius.app"
pkg: /data/local/tmp/com.vlad.genius.app
Failure [INSTALL_FAILED_DEXOPT]

I running virtual device with wipe user data, but it is don`t help me.

In Logcat i see that line:

05-04 16:44:49.940    1775-1775/? W/dalvikvm﹕ DexOptZ: zip archive '/data/app/com.vlad.genius.app-1.apk' does not include classes.dex
05-04 16:44:49.940      956-956/? W/installd﹕ DexInv: --- END '/data/app/com.vlad.genius.app-1.apk' --- status=0xff00, process failed
05-04 16:44:49.940      956-956/? E/installd﹕ dexopt failed on '/data/dalvik-cache/data@[email protected]@classes.dex' res = 65280
like image 719
Vlad Avatar asked May 04 '14 20:05

Vlad


1 Answers

The most common cause of the problem is dex limits on android. There are two kinds of limit, first on the number of methods that you can have and second around the cache size (in a way directly related)

Google documents this problem here : http://code.google.com/p/android/issues/detail?id=22586

So the first question would be which android version are you trying to install. Then use the dexdump tool (in build-tool in android SDK) and find out the number of methods you have.

like image 172
lazywiz Avatar answered Nov 19 '22 13:11

lazywiz