title: How can I test if ProGuard works correctly before I publish an app to Google Play?
body: <p>I have read the <a href="https://medium.com/androiddevelopers/troubleshooting-proguard-issues-on-android-bce9de4f8a74" rel="nofollow noreferrer">article</a>. The author think every Android app should use code shrinking.</p>
  <p>I use the following code to shrink and obfuscate code, <code>proguard-rules.pro</code> is original and blank, and <code>proguard-android-optimize.txt</code> is original. it's default made by Android Studio.</p>
  <p>You know that some project can work well in Android Studio but failed after publish to Google Play, you can see the <a href="https://stackoverflow.com/questions/66718190/why-can-an-app-run-in-real-device-by-android-studio-and-failed-by-install">article</a>.</p>
  <p>When an app run in Android Studio, I think ProGuard doesn't work and it doesn't shrink and obfuscate code, so the app works well in Android Studio.</p>
  <p>When I generate .aab file for publish in Android Studio, the ProGuard will shrink and obfuscate code, but it maybe cause runtime error due to incorrectly shrink and obfuscate operation.</p>
  <p>How can I test if ProGuard works correctly before I publish an app to Google Play ?</p>
  <pre><code>buildTypes {
      release {         
          minifyEnabled false
          shrinkResources false
          proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
      }
  
      debug {
      }
  }
  </code></pre>
  <p><strong>Add content:</strong></p>
  <p>To Ryan M: Thanks!</p>
  <p>It seems that I can test whether ProGuard works correctly in Android Studio by the <a href="https://medium.com/androiddevelopers/practical-proguard-rules-examples-5640a3907dc9" rel="nofollow noreferrer">article</a>.</p>
  <p>You can see <em>Code A</em> and <em>Image A</em>.</p>
  <p>Is that right?</p>
  <p><strong>Code A</strong></p>
  <pre><code>debugMini {
      initWith debug
      minifyEnabled true
      shrinkResources true
      proguardFiles getDefaultProguardFile('proguard-android.txt'),
              'proguard-rules.pro'
      matchingFallbacks = ['debug']
  }
  </code></pre>
  <p><strong>Image A</strong></p>
  <p><a href="https://i.stack.imgur.com/RckUA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RckUA.png" alt="enter image description here" /></a></p>