title: default config not recognised in Android studio
body: <p>On updating to Android studio 3.1, i am getting this error </p>
  
  <p>The SourceSet 'defaultConfig' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?</p>
  
  <p>build gradle</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  buildscript {
      repositories {
          mavenCentral()
          maven {
              url 'https://maven.google.com/'
              name 'Google'
          }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.1.0'
          classpath 'com.google.gms:google-services:3.1.1'
          // classpath 'com.android.tools.build:gradle:2.3.3'
          //classpath 'com.android.tools.build:gradle:2.2.2'
      }
  }
  allprojects {
      repositories {
          mavenLocal()
          mavenCentral()
          jcenter()
  
      maven {
          url 'https://maven.google.com/'
          name 'Google'
      }
  }
  }
  
  
  apply plugin: 'android'
  
  dependencies {
      implementation fileTree(dir: 'libs', include: '*.jar')
      implementation 'com.google.android.gms:play-services-auth:12.0.1'
      implementation 'org.apache.commons:commons-lang3:3.4'
      implementation 'com.github.barteksc:android-pdf-viewer:2.7.0'
      implementation 'com.google.firebase:firebase-messaging:12.0.1'
      implementation 'com.google.android.gms:play-services-gcm:12.0.1'
  
  }
  
  android {
      compileSdkVersion 27
      buildToolsVersion '27.0.3'
      //buildToolsVersion "21.1.2"
  //    useLibrary 'org.apache.http.legacy'
      dexOptions {
          preDexLibraries = false
          javaMaxHeapSize "4g"
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_8
          targetCompatibility JavaVersion.VERSION_1_8
      }
  sourceSets {
      main {
          manifest.srcFile 'AndroidManifest.xml'
          java.srcDirs = ['src']
          resources.srcDirs = ['src']
          aidl.srcDirs = ['src']
          renderscript.srcDirs = ['src']
          res.srcDirs = ['res']
          assets.srcDirs = ['assets']
      }
  
      defaultConfig {
          applicationId "com.mpathway.xxxx"
          minSdkVersion 14
          targetSdkVersion 27
          versionCode 2
          versionName "2.0"
      }
      // Move the tests to tests/java, tests/res, etc...
  //        instrumentTest.setRoot('tests')
  
      // Move the build types to build-types/&lt;type&gt;
      // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
      // This moves them out of them default location under src/&lt;type&gt;/... which would
      // conflict with src/ being used by the main source set.
      // Adding new build types or product flavors should be accompanied
      // by a similar customization.
      debug.setRoot('build-types/debug')
      release.setRoot('build-types/release')
  }
  defaultConfig {
      testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
  }
  }
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>i am getting warning on compile even though i removed and error on defaultconfig</p>
  
  <p>Can someone help me out with this issue?and let me know what to replace it with
  Thank you </p>