1

Topic: Android Studio to leave names of parameters and method variables in release

Android Studio with Gradle and ProGuard, it is necessary at release for the assembly, to leave names of parameters  and names of their local variables, by default they are cut, in javac it should dare a key-g:vars
Here the approximate config which tried:

apply plugin: ' com.android.application'
preBuild {
doFirst {
JavaCompile jc = android.applicationVariants.find {it.name == ' release '}.javaCompile
jc.options.compilerArgs = ["-g:vars"]
}
}
android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
defaultConfig {
applicationId "com.app"
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
proguardFiles getDefaultProguardFile (' proguard-android.txt '), ' proguard-rules.pro'
minifyEnabled true
shrinkResources true
}
}
}

Result did not give, names of local variables of a method are cut, yes here there can be still a hitch in usage , but it is necessary how to force all to work together and what in 0 there were names of local variables of a method and parameters?

2

Re: Android Studio to leave names of parameters and method variables in release

It is strange that there is no config ...
https://stackoverflow.com/questions/746 … ar-package
Its main counter just in reducing byte the code at the expense of renaming of classes and variables.
Easier absolutely to disconnect it.