androidlinux-kernelgoogle-play-servicesandroid-install-apkdx

Installation error: INSTALL_FAILED_DEXOPT


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@app@com.xxxxx.xxxx.android-1.apk@classes.dex' res = 11

Solution

  • 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