title: how to fix proguard warning 'can't find referenced method' for existing methods 'clone' and 'finalize' of class java.lang.Object
body: <p>I try to compress an android app that consumes <code>ical4j.jar</code>.</p>
  
  <p>When i build the apk with proguard using <code>gradle proguardDebug</code> i get</p>
  
  <ul>
  <li>Warning: net.fortuna.ical4j.model.CalendarFactory: can't find referenced method 'void finalize()' in library class java.lang.Object
  <ul>
  <li>6 additional similar warnings for <code>finalize()</code></li>
  </ul></li>
  <li>Warning: net.fortuna.ical4j.model.CalendarFactory: can't find referenced method 'java.lang.Object clone()' in library class java.lang.Object
  <ul>
  <li>6 additional similar warnings for <code>clone()</code></li>
  </ul></li>
  </ul>
  
  <p>I already verified that android-7 supports <code>finalize()</code> and <code>clone()</code>: "...\Android...\sdk\platforms\android-7\android.jar" has methods <code>finalize()</code> and <code>clone()</code> in class <code>java.lang.Object</code> .</p>
  
  <p>Do you have any idea how to fix this?</p>
  
  <p>Note: this is not a duplicate of other 'proguard can't find referenced method' questions because in my specific case i think that the missing method should be there.</p>
  
  <p>I am using </p>
  
  <ul>
  <li>proguard-4.11 with </li>
  <li>gradle-1.11
  <ul>
  <li>Groovy:       1.8.6</li>
  <li>Ant:          Apache Ant(TM) version 1.9.2 compiled on July 8 2013</li>
  <li>Ivy:          2.2.0</li>
  <li>JVM:          1.7.0_25 (Oracle Corporation 23.25-b01)</li>
  <li>OS:           Windows 7 6.1 amd64</li>
  </ul></li>
  <li>ical4j.jar 1.0.5</li>
  </ul>
  
  <p>this is proguard config <code>proguard-rules.txt</code> that probably need some fix:</p>
  
  <pre><code>#  proguard-rules.txt
  ## ical4j also contains groovy code which is not used in android 
  -dontwarn groovy.**
  -dontwarn org.codehaus.groovy.**
  -dontwarn org.apache.commons.logging.**
  -dontwarn sun.misc.Perf
  
  -dontnote com.google.vending.**
  -dontnote com.android.vending.licensing.**
  </code></pre>
  
  <p>This is my <code>build.gradle</code></p>
  
  <pre><code>    buildscript {
          repositories {
              mavenCentral()
          }
          dependencies {
              classpath 'com.android.tools.build:gradle:0.9.+'
              classpath 'net.sf.proguard:proguard-gradle:4.11'
          }
      }
  
      allprojects {
          repositories {
              mavenCentral()
          }
      }
  
      apply plugin: 'android'
  
      configurations {
          compile.exclude group: 'commons-logging' // referenced in some portable lib. use androids internal instead
      }
  
      android {
          compileSdkVersion 19
          buildToolsVersion '19.0.3'
  
          packagingOptions {
              exclude 'META-INF/LICENSE.txt'
              exclude 'META-INF/NOTICE.txt'
          }
  
          defaultConfig {
              minSdkVersion 7
              targetSdkVersion 19
          }
  
          buildTypes {
              release {
                  runProguard false
                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
              }
  
              // used for testing. remove if it works as expected
              debug {
                  runProguard true
                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
              }
          }
      }
  
      dependencies {
          compile 'org.mnode.ical4j:ical4j:1.0.5'
          compile 'backport-util-concurrent:backport-util-concurrent:3.1'
          compile 'commons-codec:commons-codec:1.8'
          compile 'commons-lang:commons-lang:2.6'
      }
  </code></pre>
  
  <p>[Update 2014-12-20]</p>
  
  <p>I have added my working configuration as answer below.</p>
  
  <p>Note: with Current Android Studio 1.0 (android.buildToolsVersion >= '20') you must replace
  <strong>runProguard</strong> with <strong>minifyEnabled</strong></p>
  
  <p>Example</p>
  
  <pre><code>    android {
          buildTypes {
              release {
                  minifyEnabled true
                  proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
              }
      }
  </code></pre>