title: Proguard dontwarn and dontnote not taking effect
body: <p>I am building an Android project that has some buildTypes that are using Proguard. During the build I am seeing a ton of warnings from Proguard. Because these warnings are generated for third party classes that I am using I'm attempting to use the -dontwarn flag and -dontnote flag in my 'proguard-rules.pro' file so that I won't see the error output in the future. However, the issue I'm seeing is that even after I add these flags to my .pro file and specify the .pro file in the build.gradle I'm still seeing the warnings output when the project is built.</p>
  
  <p>Here is the relevant part of the build.gradle file:</p>
  
  <pre><code>    buildTypes {
          debug {
              applicationIdSuffix ".debug"
          }
  
          unitTest {
              applicationIdSuffix ".unittest"
              minifyEnabled true
  //            proguardFiles getDefaultProguardFile("proguard-android.txt")
              proguardFile('proguard-rules.pro')
          }
  
          automation {
              applicationIdSuffix ".automation"
              minifyEnabled true
  //            proguardFile getDefaultProguardFile('proguard-android.txt')
              proguardFile('proguard-rules.pro')
  
          }
  
          internal {
              applicationIdSuffix ".internal"
              minifyEnabled true
  //            proguardFiles getDefaultProguardFile('proguard-android.txt')
              proguardFile('proguard-rules.pro')
          }
  
          release {
              minifyEnabled true
  //            proguardFiles getDefaultProguardFile("proguard-android.txt")
              proguardFile("proguard-rules.pro")
          }
      }
  </code></pre>
  
  <p>Here's my proguard-rules.pro file:</p>
  
  <pre><code># Add project specific ProGuard rules here.
  # By default, the flags in this file are appended to flags specified
  # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
  # You can edit the include path and order by changing the proguardFiles
  # directive in build.gradle.
  #
  # For more details, see
  #   http://developer.android.com/guide/developing/tools/proguard.html
  
  # Add any project specific keep options here:
  
  # If your project uses WebView with JS, uncomment the following
  # and specify the fully qualified class name to the JavaScript interface
  # class:
  #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  #   public *;
  #}
  
  # Disabling obfuscation is useful if you collect stack traces from production crashes
  # (unless you are using a system that supports de-obfuscate the stack traces).
  -dontobfuscate
  
  # React Native
  
  # Keep our interfaces so they can be used by other ProGuard rules.
  # See http://sourceforge.net/p/proguard/bugs/466/
  -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
  -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
  
  # Do not strip any method/class that is annotated with @DoNotStrip
  -keep @com.facebook.proguard.annotations.DoNotStrip class *
  -keepclassmembers class * {
      @com.facebook.proguard.annotations.DoNotStrip *;
  }
  
  -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
    void set*(***);
    *** get*();
  }
  
  -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
  -keep class * extends com.facebook.react.bridge.NativeModule { *; }
  -keepclassmembers,includedescriptorclasses class * { native &lt;methods&gt;; }
  -keepclassmembers class *  { @com.facebook.react.uimanager.UIProp &lt;fields&gt;; }
  -keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactProp &lt;methods&gt;; }
  -keepclassmembers class *  { @com.facebook.react.uimanager.annotations.ReactPropGroup &lt;methods&gt;; }
  
  -dontwarn com.facebook.react.**
  
  # okhttp
  
  -keepattributes Signature
  -keepattributes *Annotation*
  -keep class com.squareup.okhttp.** { *; }
  -keep interface com.squareup.okhttp.** { *; }
  -dontwarn com.squareup.okhttp.**
  
  # okio
  
  -keep class sun.misc.Unsafe { *; }
  -dontwarn java.nio.file.*
  -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
  -dontwarn okio.**
  
  # stetho
  
  -dontwarn com.facebook.stetho.**
  
  ##ADDED TO GET WARNINGS TO GO AWAY BUT NEEDS TO BE EVALED BEFORE RELEASE
  -dontnote junit.runner.*
  -dontnote junit.framework.*
  -dontwarn org.hamcrest.**
  -dontwarn android.support.test.**
  </code></pre>
  
  <p>Note the proguard-rules.pro file is located in my project/app/ directory next to the build.gradle file that references it.</p>
  
  <p>Here's a snippet of the error output from gradle:</p>
  
  <pre><code>Note: duplicate definition of library class [junit.runner.Version]
  Note: duplicate definition of library class [junit.runner.BaseTestRunner]
  Note: duplicate definition of library class [junit.framework.Protectable]
  Note: duplicate definition of library class [junit.framework.Assert]
  Note: duplicate definition of library class [junit.framework.TestSuite]
  Note: duplicate definition of library class [junit.framework.Test]
  Note: duplicate definition of library class [junit.framework.ComparisonFailure]
  Note: duplicate definition of library class [junit.framework.TestFailure]
  Note: duplicate definition of library class [junit.framework.TestCase]
  Note: duplicate definition of library class [junit.framework.AssertionFailedError]
  Note: duplicate definition of library class [junit.framework.TestListener]
  Note: duplicate definition of library class [junit.framework.TestResult]
  Reading library jar [/Users/dhodapp/Library/Android/sdk/platforms/android-23/optional/org.apache.http.legacy.jar]
  Note: duplicate definition of library class [android.net.http.SslCertificate]
  Note: duplicate definition of library class [android.net.http.SslError]
  Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
  Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
  Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
  Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
  Note: duplicate definition of library class [org.apache.http.params.HttpParams]
  Note: there were 19 duplicate class definitions.
        (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
  Warning: org.hamcrest.integration.EasyMock2Adapter: can't find superclass or interface org.easymock.IArgumentMatcher
  Warning: org.hamcrest.integration.JMock1Adapter: can't find superclass or interface org.jmock.core.Constraint
  Warning: library class android.test.AndroidTestCase extends or implements program class junit.framework.TestCase
  Warning: library class android.test.AndroidTestRunner extends or implements program class junit.runner.BaseTestRunner
  Warning: library class android.test.InstrumentationTestCase extends or implements program class junit.framework.TestCase
  Warning: library class android.test.InstrumentationTestSuite extends or implements program class junit.framework.TestSuite
  </code></pre>
  
  <p>Why aren't the error messages being squashed when I apply the proguard-rules.pro file?</p>