What is the default for minifyEnabled for buildType not explicitly scripted?

穿精又带淫゛_ 提交于 2019-11-30 08:50:30

The default value for minifyEnabled is false for all build types, as @laalto answered.

However, currently (as of 2015-04-24), this is not true for multi-module projects, in which some modules (app included) are dependent on other modules. This is due to bug #52962 that causes build types to not propagate to libraries -- they're always built as RELEASE.

Suggestions to work around this bug or notifications of its fix are most welcome.

laalto

What is the default for minifyEnabled for debug build?

The default value for minifyEnabled is false for all build types. Reference.

The problem, however, is that minify seems to be happening in non-release build (i.e. debug) as well!

How is this possible?

Your debug build gets proguard treatment possibly by some other definition somewhere, or an external build script you're using.


In your updated question, you have a library project and an app project that uses a minified library even for debug builds. That's a "feature". For a solution, consider the following also mentioned in the issue report:

Build all variants of the library project by adding the following to its build.gradle:

android {
    publishNonDefault true
}

In the app project, choose the build type specific dependency with

dependencies {
    releaseCompile project(path: ':theotherproject', configuration: 'release')
    debugCompile project(path: ':theotherproject', configuration: 'debug')
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!