title: NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags'
body: <p>My app was working fine, and I then included the support design library in the build.gradle</p>
  
  <pre><code>compile 'com.android.support:design:23.2.1'
  </code></pre>
  
  <p>Android Studio prompted to download more components and after that I started seeing way too many of these crashes when navigation b/w different fragments</p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: com.presdo.match.matchtemplate, PID: 23339
  java.lang.NullPointerException: Attempt to read from field 'int android.view.View.mViewFlags' on a null object reference
      at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3197)
      at android.view.View.draw(View.java:15234)
      at android.widget.FrameLayout.draw(FrameLayout.java:598)
      at android.view.View.updateDisplayListIfDirty(View.java:14167)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3389)
      at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3368)
      at android.view.View.updateDisplayListIfDirty(View.java:14127)
      at android.view.View.getDisplayList(View.java:14189)
      at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:273)
      at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:279)
      at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:318)
      at android.view.ViewRootImpl.draw(ViewRootImpl.java:2530)
      at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2352)
      at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1982)
      at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
      at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
      at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
      at android.view.Choreographer.doCallbacks(Choreographer.java:580)
      at android.view.Choreographer.doFrame(Choreographer.java:550)
      at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
      at android.os.Handler.handleCallback(Handler.java:739)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:135)
      at android.app.ActivityThread.main(ActivityThread.java:5254)
      at java.lang.reflect.Method.invoke(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:372)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
  </code></pre>
  
  <p>This is my build.gradle</p>
  
  <pre><code>compile 'com.android.support:appcompat-v7:23.2.1'
  compile 'com.android.support:recyclerview-v7:+'
  compile 'com.android.support:cardview-v7:23.+'
  compile 'com.android.support:support-v4:23.0.0'
  compile 'com.android.support:percent:23.1.1'
  compile 'com.android.support:multidex:1.0.0'
  compile 'com.android.support:palette-v7:23.1.0'
  </code></pre>
  
  <p>I have already looked at <a href="https://stackoverflow.com/questions/33242776/android-viewgroup-crash-attempt-to-read-from-field-int-android-view-view-mview">this</a> and I am not yet sure if it has something to do with my code. </p>
  
  <p>Now, even if I remove the google design support library, I see the crashes, and not able to predict when they happen, since there is no reference to my project's code base in the stacktrace.</p>
  
  <p>Any help is appreciated.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I made changes to the Gradle to make the support library versions consistent, and I don't see the crashes anymore. Here is a snippet</p>
  
  <pre><code>ext {
      supportLibVersion = '23.2.1'
  }
  
  dependencies {
      compile "com.android.support:appcompat-v7:${supportLibVersion}"
      compile "com.android.support:recyclerview-v7:${supportLibVersion}"
      compile "com.android.support:cardview-v7:${supportLibVersion}"
      compile "com.android.support:support-v4:${supportLibVersion}"
      compile "com.android.support:percent:${supportLibVersion}"
      compile "com.android.support:palette-v7:${supportLibVersion}"
      compile "com.android.support:design:${supportLibVersion}"
      ...
  }
  </code></pre>