title: Android build release failed with Caused by: java.lang.ArrayIndexOutOfBoundsException: 213 (proguard issue)
body: <p>My project is built fine with debug build variant, but with release variant Android Studio throws:</p>
  
  <blockquote>
    <p>Caused by: java.lang.ArrayIndexOutOfBoundsException: 213</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/aeDzp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aeDzp.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/KkGXX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KkGXX.png" alt="enter image description here"></a></p>
  
  <p>What could be the issue?</p>
  
  <p>If I set <code>minifyEnabled false</code> in build gradle for release build variant then it is being built ok, but it's not good</p>
  
  <p><strong>Update</strong> </p>
  
  <p>I tried to add to <code>proguard-rules.pro</code> <code>-keepnames class com.google.android.gms.** {*;}</code></p>
  
  <p>And it builds but I don't like this solution, I don't want to keep everything of that <code>com.google.android.gms</code>...</p>
  
  <p>Any good solution?</p>
  
  <p>p.s. I use <code>classpath 'com.google.gms:google-services:4.2.0'</code> it root build.gradle as a dependency </p>
  
  <p><strong>Update 2</strong></p>
  
  <p>Now it started to throw <code>Execution failed for task ':app:transformClassesWithDexBuilderForRelease'.</code></p>
  
  <p>Multi Dex library is used of course (I'm targeting Android API 14+)</p>