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 environment, this was translated to the following in the build.gradle
script (by the import, not by me):
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
I understand that this means that "in release
build, enable Proguard's minify, using proguard.cfg".
The problem, however, is that minify seems to be happening in non-release build (i.e. debug) as well!
How is this possible?
What is the default for minifyEnabled for debug build?
UPDATE 1: Thanks to the answer below, I now know that the default is false
. Which means something else is building the various modules minified in debug build.
I am posting the entire build.gradle for one of the modules that get minified in debug build:
apply plugin: 'com.android.library'
android {
compileSdkVersion 8
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 8
}
buildTypes {
release {
minifyEnabled true
proguardFiles 'proguard.cfg'
}
}
}
The entire build.gradle
for the project itself (i.e. top level) is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
I cannot spot here anything that could explain enforcing minify on a debug build.
UPDATE 2: Suspecting a mismatch between app's build (debug
) and the modules on which it depends (release
?), I also checked the Build Variant view on the the left panel. The all show debug
unequivocally.
UPDATE 3: It appears that I hit a bug/limitation in Android-Gradle?
I truly need all modules built in debug
mode when the app is built in debug
mode.
Any ideas how I can solve this problem?