Android是什么multidex? [英] What is android multidex?

查看:326
本文介绍了Android是什么multidex?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有许多后约multidex。我经历了一些时代的错误解决包括在我的build.gradle的defaultConfig部分multiDexEnabled真正

There are many post about multidex. I experienced some times errors solved including multiDexEnabled true in defaultConfig section of my build.gradle.

但是,究竟是什么这个功能吗?这是场景使用它吗?

But, what is exactly this feature? Which are the scenarios for using it?

推荐答案

Android应用(APK)文件包含在可执行的Dalvik(DEX)文件形式的可执行字节code文件,其中包含编译code用于运行应用程序。在Dalvik可执行的规范限制了可以在单个文件DEX内引用65,536,包括Android框架方法,库方法,并在自己的code方式方法的总数。获得过去此限制,您需要配置您的应用程序的构建过程,生成多个文件DEX,被称为multidex配置。

Android application (APK) files contain executable bytecode files in the form of Dalvik Executable (DEX) files, which contain the compiled code used to run your app. The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536, including Android framework methods, library methods, and methods in your own code. Getting past this limit requires that you configure your app build process to generate more than one DEX file, known as a multidex configuration.

所以,特点是:它可以让​​您的复杂应用程序进行编译。使用它的场景是,当你的应用程序编译失败,由于撞击64K DEX方法参考限值。这似乎是一个生成错误,如:

So, the feature is: it allows your complex app to compile. The scenarios for using it are when your app fails to compile due to hitting the 64K DEX method reference limit. This appears as a build error, such as:

Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

这篇关于Android是什么multidex?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆