title: Exception java.lang.NoClassDefFoundError: Landroid/app/usage/NetworkStatsManager
body: <p>I compiled app and distribute it to users with <code>Google Play</code>. I integrated <code>Firebase Crash</code> there and now I see a lot of errors in console. </p>
  
  <pre><code>Exception java.lang.NoClassDefFoundError: Failed resolution of: Landroid/app/usage/NetworkStatsManager;
  
  Caused by java.lang.ClassNotFoundException: Didn't find class "android.app.usage.NetworkStatsManager" on path: DexPathList[[zip file "/data/app/com.xxx.yyy/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
  </code></pre>
  
  <p>I use ProGuard with default settings. Is there anything I can do to fix this?
  I compiled it with <code>Android Studio 2.2 Preview 4</code>.</p>
  
  <p>Thank you for any help.</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>I recheck my code and I am ashamed that I asked this : ) Why?</p>
  
  <p>As you suggested, I should check API version, which I did, but because I develop multi-version application (working different way based on API version), I had to "disable" warning about API version. </p>
  
  <p>I made stupid mistake, because I implemented function required API23, before I check, if there is API23. </p>
  
  <p>Is there any better way how to do this, or doing following <strong>if API</strong> is best approach? </p>
  
  <pre><code>if (android.os.Build.VERSION.SDK_INT &gt;= android.os.Build.VERSION_CODES.M)
          {
              return true;
          }
  else
          {
              return false;
          }
  </code></pre>