title: Android Gradle plugin 3.0.1 must not be applied to project
body: <p>I keep getting this error when I try to build my project. I have no idea what is wrong with it and nothing I try is working.</p>
  
  <p>I've trying cleaning, restarting Android Studio, and stopping the daemon with gradlew --stop.</p>
  
  <p>Please help me!</p>
  
  <p>Error: </p>
  
  <pre><code>Android Gradle plugin 3.0.1 must not be applied to project since version 3.0.1 was already applied to this project
  </code></pre>
  
  <p>Module:app script</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 26
      apply plugin: 'com.android.library'
  
      defaultConfig {
          applicationId "com.example.joey.projectgenesis"
          minSdkVersion 26
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation 'com.android.support:design:26.1.0'
      implementation 'com.google.android.gms:play-services-ads:11.8.0'
      testImplementation 'junit:junit:4.12'
      androidTestImplementation 'com.android.support.test:runner:1.0.1'
      androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
      implementation 'com.android.support:gridlayout-v7:26.1.0'
  }
  </code></pre>
  
  <p>Project script </p>
  
  <pre><code>    // Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
  
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
  
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>gradle.wrapper.properties</p>
  
  <pre><code>#Fri Jan 12 20:21:58 EST 2018
  distributionBase=GRADLE_USER_HOME
  distributionPath=wrapper/dists
  zipStoreBase=GRADLE_USER_HOME
  zipStorePath=wrapper/dists
  distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
  </code></pre>