Installation error: INSTALL_FAILED_DEXOPT

1k views Asked by At

Hi I have very big problem my application size is around 10mb and i have 7mb of junit's (jar) files .Recently I updated googleplayservice with my application after adding that my apk is not installed into the device which has api level lesser than 11. I have added my log cat out puts here.

08-01 15:09:25.333: E/dalvikvm(429): LinearAlloc exceeded capacity (5242880), last=100
08-01 15:09:25.333: E/dalvikvm(429): VM aborting
08-01 15:09:25.522: W/installd(34): DexInv: --- END '/data/app/com.xxxxxx.xxxx.android-1.apk' --- status=0x000b, process failed
08-01 15:09:25.522: E/installd(34): dexopt failed on '/data/dalvik-cache/data@[email protected]@classes.dex' res = 11
2

There are 2 answers

0
Radhakrishnan On BEST ANSWER
The issues is our method reaches 64k size.
Easy solution for this issues is we need to reduce our function or we need to remove few library which is not necessary.
Best solution is we can use  ant build to take apk. and create build.xml file to  split our library in to two files and we can inject that library in runtime.
We solved that issues buy using ant build.

One more option is available in android studio they have introduced a feature called multiple dex file so using that we can over come this issues.

Edits on 06-04-2015

The problem will rise when you update you google play services so instead of add the whole play service android studio provide a way to add particular api to the project Reference it will reduce your methods

1
Rafael Sanches On

The same here. I could only fix by downgrading google play services to 5089000.

The real reason why this was happening for me, was because the play services is too big and go over the compilation method limit.

I had to download the play services separated jars and compile it from there.

The reason why this happen is because google ships now a huge jar in the Android ADT if you opt to download the lib from there. Where, if you download from gradle you can pick and chose only the jars that you actually use.

Since I don't use gradle, I had to create a fake gradle project to be able to download those play services separated jars that I need.

Pretty messy.