title: Many error messages after updating Gradle plugin for Android to 2.0.0
body: <p>Since updating Gradle Plugin for Android to 2.0.0, there are many error messages in all projects in Android Studio 2.0.</p>
  
  <p>I would like to know the reason for this and possibly how to avoid it.</p>
  
  <p>This seems <em>not</em> related to the code of my projects, as the errors also show up in an empty or blank project. There are in fact hundreds of lines of warnings and errors, even before first call of onCreate() in a blank project.</p>
  
  <p>This is a small excerpt of the logged errors:</p>
  
  <pre><code>I/dalvikvm: Could not find method android.content.Context.getSystemService, referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve virtual method 450: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object;
  D/dalvikvm: VFY: replacing opcode 0x6f at 0x004b
  I/dalvikvm: Could not find method android.app.Activity.stopLockTask, referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve virtual method 246: Landroid/app/Activity;.stopLockTask ()V
  D/dalvikvm: VFY: replacing opcode 0x6f at 0x00b9
  E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve check-cast 229 (Landroid/os/PersistableBundle;) in Lcom/example/test/MainActivity;
  D/dalvikvm: VFY: replacing opcode 0x1f at 0x00f1
  I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve virtual method 432: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
  D/dalvikvm: VFY: replacing opcode 0x6f at 0x0101
  I/dalvikvm: Could not find method android.app.Activity.onVisibleBehindCanceled, referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve virtual method 169: Landroid/app/Activity;.onVisibleBehindCanceled ()V
  D/dalvikvm: VFY: replacing opcode 0x6f at 0x0111
  I/dalvikvm: Could not find method android.app.Activity.onWindowStartingActionMode, referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve virtual method 173: Landroid/app/Activity;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
  D/dalvikvm: VFY: replacing opcode 0x6f at 0x0137
  E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.example.test.MainActivity.access$super
  W/dalvikvm: VFY: unable to resolve check-cast 229 (Landroid/os/PersistableBundle;) in Lcom/example/test/MainActivity;
  D/dalvikvm: VFY: replacing opcode 0x1f at 0x019a
  E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.example.test.MainActivity.access$super
  </code></pre>
  
  <p>With Gradle Plugin 1.5.0 everything went fine.
  With Gradle Plugin 2.0.0 these errors come up.</p>
  
  <p>I updated to 2.0.0, because Android Studio 2.0 recommends the update: </p>
  
  <blockquote>
    <p>The project is using an old version of the Android Gradle plugin. To
    take advantage of all the latest features, such as Instant Run, we
    strongly recommend that you update the Android Gradle plugin to
    version 2.0.0.</p>
  </blockquote>
  
  <p>As there are hundreds of lines of errors at the start of any app and many more later, this makes using logcat for debugging extremely difficult.</p>
  
  <p>I have tried to downgrade to 1.5.0 as described <a href="https://stackoverflow.com/a/36532768/6221631">in this answer</a>. This does actually prevent the errors to come up. Anyhow, I do not regard this as a solution, but rather a work-around, as I cannot use the new features of plugin 2.0.0.</p>