title: Unable to load class 'com.android.builder.Version' after upgrade to Android Studio 3.1
body: <p>I've upgraded to Android Studio 3.1 in Canary channel and I cannot build my project anymore, this error is printed:</p>
  
  <blockquote>
    <p>Unable to load class 'com.android.builder.Version'. Possible causes
    for this unexpected error include:</p>
    
    <ul>
    <li>Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync
    project (requires network)</li>
    <li>The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build
    processes (requires restart)</li>
    </ul>
    
    <p>Your project may be using a third-party plugin which is not compatible
    with the other plugins in the project or the version of Gradle
    requested by the project. In the case of corrupt Gradle processes, you
    can also try closing the IDE and then killing all Java processes.</p>
  </blockquote>
  
  <p>I already tried both of those solutions and also tried deleting all the <code>~/.gradle/caches</code> directory but the error persists.</p>
  
  <p>Looking for similar error I've found the old version of Android Studio having this issues with the suggested solution to upgrade the android tools version.</p>
  
  <p>I think I already have the last one:</p>
  
  <pre><code>    classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
  </code></pre>
  
  <p><strong>EDIT (30 Oct 2017):</strong></p>
  
  <p>Answers show that someone is having the issue while someone isn't.
  As pointed out in the comments to this question this can be caused by a non compatible plugin, so I list the plugins used in my project here:</p>
  
  <pre><code>buildscript {
      ext.kotlin_version = '1.1.51'
      repositories {
          jcenter()
          google()
  //        maven {
  //            url 'https://maven.google.com'
  //        }
          maven {
              url "https://plugins.gradle.org/m2/"
          }
      }
      dependencies {
          classpath "com.gradle:build-scan-plugin:1.10"
          classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.1'
          classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
          classpath 'com.google.gms:google-services:3.1.1'
          classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
      }
  }
  </code></pre>
  
  <p>The dexcount one is currently not used tough because of some incompatibilities with newer versions of Android plugin.</p>