title: Android Studio update - Failed to resolve com.android.databinding
body: <p>I recently updated my JAVA to 1.8 version and also made android studio updates and gradle plugin updates as well. After the update i get following error in one of my module's(i.e. facebook module) build.gradle file on compiling my project: </p>
  
  <p><a href="https://i.stack.imgur.com/a3Bfq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a3Bfq.png" alt="enter image description here"></a></p>
  
  <p>My project level build.gradle looks like this:</p>
  
  <pre><code>buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.3.0-beta4'
          classpath 'com.google.gms:google-services:2.0.0-alpha6'
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  </code></pre>
  
  <p>Also there are few Symbol not found error like Cannot resolve Symbol 'GradleScriptException' and Cannot resolve symbol 'MavenDeployment' in facebook module build.gradle file. The full code of facebook buil.gradle is:</p>
  
  <pre><code>apply plugin: 'com.android.library'
  
  repositories {
      mavenCentral()
  }
  
  project.group = 'com.facebook.android'
  
  dependencies {
      // Facbook Dependancies
      testCompile 'com.android.support:appcompat-v7:23.0.1'
      compile 'com.android.support:support-v4:23.0.1'
      compile 'com.parse.bolts:bolts-android:1.2.1'
      // Unit Tests
      testCompile 'junit:junit:4.12'
      testCompile 'org.robolectric:robolectric:3.0'
      testCompile 'org.robolectric:shadows-support-v4:3.0'
      def powerMockVersion = '1.6.1'
      testCompile "org.powermock:powermock-module-junit4:$powerMockVersion" testCompile "org.powermock:powermock-module-junit4-rule:$powerMockVersion" testCompile "org.powermock:powermock-classloading-xstream:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
      testCompile "org.powermock:powermock-api-mockito:$powerMockVersion" androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
      // Connected Tests
      androidTestCompile 'org.mockito:mockito-core:1.10.19'
  }
  
  android {
      compileSdkVersion 23
      buildToolsVersion '25.0.0'
  
      defaultConfig {
          minSdkVersion 15
          targetSdkVersion 19
          multiDexEnabled true
      }
  
      lintOptions {
          abortOnError false
      }
      compileOptions {
          sourceCompatibility JavaVersion.VERSION_1_7
          targetCompatibility JavaVersion.VERSION_1_7
      }
      dataBinding {
          enabled = true
      }
  }
  
  apply plugin: 'maven'
  apply plugin: 'signing'
  
  def isSnapshot = version.endsWith('-SNAPSHOT')
  def ossrhUsername = hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
  def ossrhPassword = hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
  
  task setVersion {
      // The version will be derived from source
      project.version = null
      def sdkVersionFile = file('src/main/java/com/facebook/FacebookSdkVersion.java')
      sdkVersionFile.eachLine{
          def matcher = (it =~ /(?:.*BUILD = \")(.*)(?:\".*)/)
          if (matcher.matches()) {
              project.version = matcher[0][1]
              return
          }
      }
      if (project.version.is('unspecified')) {
          throw new GradleScriptException('Version could not be found.', null)
      }
  }
  
  uploadArchives {
      repositories.mavenDeployer {
          beforeDeployment { MavenDeployment deployment -&gt; signing.signPom(deployment) }
  
          repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
              authentication(userName: ossrhUsername, password: ossrhPassword)
          }
  
          snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
              authentication(userName: ossrhUsername, password: ossrhPassword)
          }
  
          pom.project {
              name 'Facebook-Android-SDK'
              artifactId = 'facebook-android-sdk'
              packaging 'aar'
              description 'Facebook Android SDK'
              url 'https://github.com/facebook/facebook-android-sdk'
  
              scm {
                  connection 'scm:git@github.com:facebook/facebook-android-sdk.git'
                  developerConnection 'scm:git@github.com:facebook/facebook-android-sdk.git'
                  url 'https://github.com/facebook/facebook-android-sdk'
              }
  
              licenses {
                  license {
                      name 'Facebook Platform License'
                      url 'https://github.com/facebook/facebook-android-sdk/blob/master/LICENSE.txt'
                      distribution 'repo'
                  }
              }
  
              developers {
                  developer {
                      id 'facebook'
                      name 'Facebook'
                  }
              }
          }
      }
  }
  
  uploadArchives.dependsOn(setVersion)
  
  signing {
      required { !isSnapshot &amp;&amp; gradle.taskGraph.hasTask("uploadArchives") }
      sign configurations.archives
  }
  
  task androidJavadocs(type: Javadoc) {
      source = android.sourceSets.main.java.srcDirs
      classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
      // JDK 1.8 is more strict then 1.7. Have JDK 1.8 behave like 1.7 for javadoc generation
      if (org.gradle.internal.jvm.Jvm.current().getJavaVersion() == JavaVersion.VERSION_1_8) {
          options.addStringOption('Xdoclint:none', '-quiet')
      }
  }
  
  task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
      classifier = 'javadoc'
      from androidJavadocs.destinationDir
  }
  
  task androidSourcesJar(type: Jar) {
      classifier = 'sources'
      from android.sourceSets.main.java.sourceFiles
  }
  
  artifacts {
      archives androidSourcesJar
      archives androidJavadocsJar
  }
  
  afterEvaluate {
      androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
  }
  </code></pre>
  
  <p>Clicking on <code>Upgrade plugin and sync project</code> does not do anything.</p>
  
  <p>I have tried "Invalidate cache and restart" as suggested by various sources but it didn't work. I already have mentioned the latest version of gradle plugin in my project build.gradle.</p>
  
  <p>I have gone through <a href="https://stackoverflow.com/questions/32893008/gradle-dsl-method-not-found-testcompile">Gradle DSL Method not found: testCompile() </a> but it does not resolve my issue.</p>
  
  <p>What should i do to remove this compile error?</p>
  
  <p>TIA</p>
  
  <p>EDIT 1:
  I made the change as suggested by sm4, And this DSL method not found error went off but now it fails to compile with the following error:</p>
  
  <p><a href="https://i.stack.imgur.com/XNLiZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XNLiZ.png" alt="Compile error"></a></p>