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

后端 未结 2 854
走了就别回头了
走了就别回头了 2020-12-31 08:14

I imported several eclipse projects to Android Studio (v1.1).

In the original Eclipse environment, they use Proguard for release mode.

In the Android Studio

2条回答
  •  星月不相逢
    2020-12-31 08:26

    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')
    }
    

提交回复
热议问题