最近我不得不为我们的应用程序启用 multidex 支持,因为它无法在许多运行旧版 Android 的设备上安装或启动时崩溃。启用后,应用程序成功安装,with some tweaking ,在除 2.3.6 以外的大多数 Android 版本上,它会给出以下消息:
Cannot Download - The content is not supported on this phone
我无法对此进行测试,因为我没有运行 2.3.6 的设备,而且 Android Studio 也没有为此版本提供模拟器。如果有人告诉我应用程序在 Android 2.3.6 上发生了什么,我将不胜感激 - 即为什么不支持应用程序在其他较低版本(如 2.3.3 和 2.2 等)上运行良好的地方。
最佳答案
其实官方页面上有提到,Android 4.0 (API level 14)之前可能有问题
https://developer.android.com/tools/building/multidex.html#limitations
这里有2个与平台版本相关的主要问题
Applications that use multidex may not start on devices that run versions of the platform earlier than Android 4.0 (API level 14) due to a Dalvik linearAlloc bug (Issue 22586). If you are targeting API levels earlier than 14, make sure to perform testing with these versions of the platform as your application can have issues at startup or when particular groups of classes are loaded. Code shrinking can reduce or possibly eliminate these potential issues.
Applications using a multidex configuration that make very large memory allocation requests may crash during run time due to a Dalvik linearAlloc limit (Issue 78035). The allocation limit was increased in Android 4.0 (API level 14), but apps may still run into this limit on Android versions prior to Android 5.0 (API level 21).
关于android - Multidex 应用程序不适用于 Android 2.3.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32522335/