Saeid Saeid - 3 years ago 869
Android Question

AndroidStudio 2.2 build gradle error ( path to custom proguard file )

previous installed

version was :
but after update to
and update gradle, building gradle has a problem Because of the proguard name.

Before, for release
i use a custom proguard config with this way:

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('fileName.txt')

but after update
AndroidStudio 2.1.3
this error occurs:

Error:(17, 0) User supplied default proguard base extension name is unsupported.
Valid values are: [proguard-android.txt, proguard-android-optimize.txt]
Open File

Notice That : After update settings and config files imported from previous version And
folder path not chnage

old way!

Unfortunately and finally, I had to use old version of AndroidStudio(2.1.3) and
this work but not is solution for AndroidStudio 2.2

Answer Source

Finally test several way i found should set complete path to proguard file like below config :

in build.gradle(module:app)

 buildTypes {
    release {
        minifyEnabled true
        proguardFile ('FullPath/.../configFileName.txt')

, and not need to using getDefaultProguardFile before path.

Too , you can paste your config file to ...\appName\app and chnage gradle file to :

 proguardFile ('configFileName.txt')

Actually , default path is .../appName/app and if you put just configFileName , this search file name in default project path.

in previous version i haven't this problem and default gradle path was ...\SDK\tools\proguard

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download