什么是地塞米松的摇篮摇篮

由网友(Broken彡柠檬)分享简介:什么是摇篮,或在Android上的DEX?What is the dex in gradle or in Android ?在摇篮,什么是 dexoptions ?有时候,我的项目并没有因为一些dexerrors的编译。我需要激活ProGuard的编译我的Andr​​oid应用程序。Sometimes my...

什么是摇篮,或在Android上的DEX?

What is the dex in gradle or in Android ?

在摇篮,什么是 dexoptions

有时候,我的项目并没有因为一些dexerrors的编译。 我需要激活ProGuard的编译我的Andr​​oid应用程序。

Sometimes my project does not compile because of some dexerrors. I need to activate proguard to compile my android app.

推荐答案

在编译标准Java code:编译器产生的* .class文件。 A *类文件包含可在标准JVM中执行标准的Java字节code。

In the standard java world:

When you compile standard java code : the compiler produce *.class file. A *class file contains standard java bytecode that can be executed on a standard JVM.

这是不同的。您可以使用Java语言编写的code,但是编译器不产生* .class文件,它产生* .dex文件。 A *。DEX 文件包含字节code,可以在Android虚拟机执行(Dalvik的),这是不是一个标准的Java虚拟机。

It is different. You use the java language to write your code, but the compiler don't produce *.class files, it produce *.dex file. A *.dex file contains bytecode that can be executed on the Android Virtual Machine (dalvik) and this is not a standard Java Virtual Machine.

需要明确的是:在Android的一个DEX文件类的标准Java等价

To be clear: a dex file in android is the equivalent of class in standard java.

所以 dexoptions 是摇篮对象的,其中一些选项来配置此的 Java的code到Android的字节code 的转换定义。通过这个对象配置的选项有:

So dexoptions is a gradle object where some options to configure this java-code-to-android-bytecode transformation are defined. The options configured via this object are :

targetAPILevel 力巨型模式(如果启用它允许在DEX文件数量较多的字符串)

要启用 jumboMode

android {
    dexOptions {
        jumboMode = true
    }
}
阅读全文

相关推荐

最新文章