android - 在 Android Studio/gradle 中构建时,API 版本 23 中未调用 dx.bat

标签 android gradle build dex dx

应用构建过程中,构建tools\23.0.3文件夹下的dx.bat没有执行。

compileSdkVersion 23
buildToolsVersion "23.0.3"

dx.bat 用于在 19 等较旧的 API 版本中执行。 在这种情况下,您能否告诉我如何在 API 版本 23 中不执行 dx.bat 的情况下生成 classes.dex。

最佳答案

Android Gradle 插件 2.1.0 版包含一个名为 Dex In Process 的功能,它允许在构建过程中而不是在外部过程中执行 dexing。

来自 official documentation :

The feature is enabled by default for projects that have set the Gradle daemon's maximum heap size to at least 2048 MB. You can do this by including the following in your project's gradle.properties file:

org.gradle.jvmargs = -Xmx2048m

To disable dexing-in-process, add the following code to your module-level build.gradle file:

android {
  ...
  dexOptions {
      dexInProcess false
  }
}

关于android - 在 Android Studio/gradle 中构建时,API 版本 23 中未调用 dx.bat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38513783/

相关文章:

gradle - Gradle/Ivy 如何读取充当 Maven 镜像的 Nexus 存储库?

gradle - 使用gradle的ActionBarSherlock和swipelistview

docker - Docker Buildx功能-不缓存

c++ - 如何为新安装的 Boost 添加编译器包含路径和链接器库路径?

java - 使用 Gradle 在 Eclipse 中自动下载库

android - 如何在屏幕方向更改期间处理传感器监控?

android - sqlite约束失败错误代码

android - ShowcaseView 解析失败

android - 如何使用谷歌地图的 API KEY

jenkins - 如何将 Gradle 构建 currentVersion 写入文件