Gradle 或 Android 中的 dex 是什么?
What is the dex in Gradle or in Android?
在Gradle中,dexoptions是什么意思?
In Gradle, what's the meaning of dexoptions?
有时我的项目由于某些 dexerrors 而无法编译.我需要激活 ProGuard 来编译我的 Android 应用程序.
Sometimes my project does not compile because of some dexerrors. I need to activate ProGuard to compile my Android app.
当您编译标准 java 代码时:编译器生成 *.class 文件.*class 文件包含可以在标准 JVM 上执行的标准 java 字节码.
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 语言编写代码,但编译器不生成 *.class 文件,它生成 *.dex 文件.*.dex 文件包含可以在 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 中的 class.
To be clear: a dex file in android is the equivalent of class in standard java.
所以 dexoptions 是一个 gradle 对象,其中定义了一些配置此 java-code-to-android-bytecode 转换的选项.通过这个对象配置的选项是:
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 :
启用 jumboMode :
android {
dexOptions {
jumboMode = true
}
}
这篇关于Gradle 中的 dex 是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)