title: How to configure ProGuard for an Android release build with Kotlin
body: <p>I added Kotlin 1.2.71 to my Android (Java) application project.
  The project is configured for Java 8:</p>
  
  <pre><code>compileOptions {
      sourceCompatibility JavaVersion.VERSION_1_8
      targetCompatibility JavaVersion.VERSION_1_8
  }
  </code></pre>
  
  <p>Here are the Kotlin changes:</p>
  
  <pre><code>classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71"
  </code></pre>
  
  <p>...</p>
  
  <pre><code>apply plugin: "kotlin-android"
  apply plugin: "kotlin-android-extensions"
  apply plugin: "kotlin-kapt"
  </code></pre>
  
  <p>...</p>
  
  <pre><code>implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71"
  kapt "org.parceler:parceler:1.1.11"
  </code></pre>
  
  <p>I noticed that the release build with ProGuard fails. The build process outputs the following information:</p>
  
  <pre class="lang-none prettyprint-override"><code>Warning: kotlin.internal.jdk8.JDK8PlatformImplementations: can't find referenced 
      method 'int start(java.lang.String)' in library class java.util.regex.Matcher
  Warning: kotlin.internal.jdk8.JDK8PlatformImplementations: can't find referenced 
      method 'int end(java.lang.String)' in library class java.util.regex.Matcher
  Warning: kotlin.internal.jdk8.JDK8PlatformImplementations: can't find referenced 
      method 'java.lang.String group(java.lang.String)' in library class java.util.regex.Matcher
  
  Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically 
      referenced class kotlin.internal.JRE8PlatformImplementations
  Note: kotlin.internal.PlatformImplementationsKt: can't find dynamically 
      referenced class kotlin.internal.JRE7PlatformImplementations
  Note: kotlin.jvm.internal.Reflection: can't find dynamically 
      referenced class kotlin.reflect.jvm.internal.ReflectionFactoryImpl
  
  Note: the configuration keeps the entry point 
      'com.google.android.gms.flags.impl.FlagProviderImpl { void init(com.google.android.gms.dynamic.zzd); }', 
      but not the descriptor class 'com.google.android.gms.dynamic.zzd'
  
  Note: there were 1 unkept descriptor classes in kept class members.
        You should consider explicitly keeping the mentioned classes
        (using '-keep').
        (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
  Note: there were 3 unresolved dynamic references to classes or interfaces.
        You should check if you need to specify additional program jars.
        (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
  Warning: there were 3 unresolved references to library class members.
           You probably need to update the library versions.
           (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
  Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
  Thread(Tasks limiter_9): destruction
  </code></pre>
  
  <p>Kotlin does not require any special ProGuard rules as far as I saw. <a href="https://stackoverflow.com/questions/33547643/how-to-use-kotlin-with-proguard">People recommend</a> (post from 2015) to put just simply rules:</p>
  
  <pre><code>-dontwarn kotlin.**
  </code></pre>
  
  <p>Is this still the recommended solution?</p>
  
  <h1>Related</h1>
  
  <ul>
  <li><a href="https://kotlinlang.org/docs/reference/android-overview.html#using-kotlin-for-android-development" rel="nofollow noreferrer">Kotlin docs: Using Kotlin for Android Development</a></li>
  <li><a href="https://stackoverflow.com/questions/33547643/how-to-use-kotlin-with-proguard">StackOverflow: How to use Kotlin with Proguard</a></li>
  <li><a href="https://sourceforge.net/p/proguard/feature-requests/182/" rel="nofollow noreferrer">ProGuard issue #182: Support Kotlin class files</a></li>
  <li><a href="https://youtrack.jetbrains.com/issue/KT-7652" rel="nofollow noreferrer">KT-7652: Specify and document Proguard rules for kotlin-reflect.jar</a></li>
  </ul>