build tools 21.1.1 proguard not recognizing `-keep` and rules

278 views Asked by At

Warning:library class org.apache.http.conn.ManagedClientConnection extends or implements program class org.apache.http.HttpClientConnection

despite having -dontwarn org.apache.** in my proguard rules file

Warning:org.joda.time.Weeks: can't find referenced class org.joda.convert.FromString

despite having -dontwarn org.joda.** in my proguard rules file, and -keep class org.** { *; } along with -keep interface org.** { *; }

Warning:there were 140 instances of library classes depending on program classes.

Error:Execution failed for task ':app:proguardRelease'.
> java.io.IOException: Please correct the above warnings first.

so then I look at my app structure

 buildTypes {
    release {

        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-project.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.release
        zipAlignEnabled true
    }
   }

proguard-project.txt is in the same folder as this build.gradle file in this module.

Not sure what is broken now, I guess there is something else that nobody told me about when I was required to update to Build Tools 21.1.1 to make other things work. any insight appreciated.

1

There are 1 answers

0
CQM On BEST ANSWER

My solution was to copy all of my rules into proguard-rules.pro which the IDE had previously automatically generated for me, and then proguard worked as expected

I still don't know where getDefaultProguardFile('proguard-project.txt') is supposed to be located, but it is not being read, I moved it within my module and in the root folder of the project.