Application crashes only in release version : <p>When you run the application in <strong>debug</strong> mode the app can't crash. But when generates the .apk file <strong>release</strong> the app crash. <strong>This error does not happen on all phones</strong>, in just a few that have the android 6.</p>

<p>The logcat shows that the problem is a <strong>NullPointerException</strong> in the  class (<strong>android.support.v4.widget.drawerlayout</strong>). How can a NullPointerException launches only on release apk?</p>

<p>We already disable proguard, minify and shrinkResources. Didn't resolve this bug.</p>

<p>Here some logs:</p>

<pre><code>Attempt to invoke virtual method 'int android.view.WindowInsets.getSystemWindowInsetLeft()' on a null object reference
  at android.support.v4.widget.i.a(Unknown Source)
  at android.support.v4.widget.DrawerLayout$d.a(Unknown Source)
  at android.support.v4.widget.DrawerLayout.onMeasure(Unknown Source)
  at android.view.View.measure(View.java:18799)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)    
  at android.support.v7.widget.ContentFrameLayout.onMeasure(Unknown Source)
  at android.view.View.measure(View.java:18799)
  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5951)
</code></pre>
