Multidex with Android 2.3 (API 9)

can anyone tell me if multi dex supports in android 2.3?

I searched, but I can not find information for this. My project has the same configuration as this one: https://github.com/mustafa01ali/MultiDexTest

The project is built without problems, but the latest apk cannot be installed on devices with 2.3 or lower.

When I install, I get an error

Failure [INSTALL_FAILED_DEXOPT] 

in Android Studio, and this is displayed in logcat:

 E/dalvikvm﹕ LinearAlloc exceeded capacity (5242880), last=1384 W/installd﹕ DexInv: --- END '/data/app/xxx.apk' --- status=0x000b, process failed E/installd﹕ dexopt failed on '/data/dalvik-cache/ data@app @ xxx.apk@classes.dex ' res = 11 
+6
source share
1 answer

You fall into another size limit (LinearAlloc), which, according to this error, is not resolved using multi-dex:

https://code.google.com/p/android/issues/detail?id=78035

From comment # 7 in this error:

Dx already has an option that allows you to force the generation of smaller files: --set-max-idx-number = Unfortunately, changing the default value is not a solution, since the linearAlloc restriction can be reached at very different levels depending on the class hierarchy and other criteria.

In addition, for most applications, moving to multidex will only contribute to circumventing the linear restriction for installation. But the application will still crash with the same execution limit. only a working use case where I know that multidex can help with linearalloc when apk does not contain one application, but the separate parts work in a separate process.

It is not clear that you can do anything to get around this limit, at least in the long run; You may need to simplify your application. Here's another StackOverflow question with some information and some workarounds that may help you get started at least for a while:

Avoiding LinearAlloc Error with Exceeded Android Bandwidth

+5
source

Source: https://habr.com/ru/post/979066/


All Articles