Home » Android » Android data Binding produces "Source folders generated at wrong location"

Android data Binding produces "Source folders generated at wrong location"

Posted by: admin April 23, 2020 Leave a comment

Questions:

Updated to Android Studio 1.3.1 and tried to configure dataBinding

Top level gradle file contains

dependencies {
    classpath 'com.android.tools.build:gradle:1.3.1'
    classpath 'com.android.databinding:dataBinder:1.0-rc1'
} 

Project gradle file contains

apply plugin: 'com.android.application'
apply plugin: 'com.android.databinding'

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.0'

but I’m getting following message

Source folders generated at incorrect location

Warning:Folder /Users/myname/workspace/discoveroom/android-client/Caldroid/build/data-binding-info/debug

Warning:Folder /Users/myname/workspace/discoveroom/android-client/DiscoveroomAndroidClient/build/data-binding-info/debug

Information:3rd-party Gradle plug-ins may be the cause

enter image description here

How to&Answers:

change

classpath 'com.android.databinding:dataBinder:1.0-rc1'

to

classpath 'com.android.databinding:dataBinder:1.0-rc4'

Answer:

(Data Binding support appears to be changing very rapidly; you’re going to find lots of outdated posts.)

In my toplevel build.gradle file, I have:

buildscript {
  repositories {
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:2+'
  }
}

There’s no change to your app build.gradle file any more; ignore old posts talking about this kind of thing:

apply plugin: 'com.android.databinding'  // OBSOLETE DO NOT USE

I’m using Android Studio 2.0 Preview 9.

In the Project Structure dialog box (Command – downarrow on a mac) make sure you’re using Gradle 2.10.

Answer:

i did not change anything but add this code

dataBinding {
        enabled = true
}

in module build.gradle file;
it success.