16

Perhaps my question seems a simple question and duplicate. But it is for me an important question. I have android studio 1.3 and when I create a new default project and then when I open the build.gradle(Module:app) , I see the following code in part of build.gradle(Module:app)file. Also you should know that when I compile my project, android studio makes two apk files that both are as the debug mode. in the following code is used from the release block and the minifyEnabled is false. Now I want to know that despite these conditions, when I compile my project, does the android studio use from proguard really? Thank you in advanced.

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
and
  • 341
  • 1
  • 3
  • 11

1 Answers1

21

Flag minifyEnabled stays for ProGuard, and it's turned off by default. So, in default setup both debug and release builds aren't using ProGuard, and parameter proguardFiles is effectively ignored

OleGG
  • 8,589
  • 1
  • 28
  • 34
  • Thank you. you say `in default setup both debug and release builds aren't using ProGuard` So, how can I turn on the `ProGuard`? – and Aug 23 '15 at 05:11
  • 8
    You just need to set `minifyEnabled` value to `true` – OleGG Aug 23 '15 at 05:12
  • 2
    I noticed I need to comment out `//proguardFiles ...` line to fix the crash caused by proguard, simply set `minifyEnabled false` not enough. – 林果皞 Jun 19 '17 at 05:28