DataBinding not working after Upgrade Android Studio 2.3

后端 未结 7 1321
挽巷
挽巷 2021-02-05 10:47

DataBinding worked very well in my project, But after upgrade Android Studio 2.3 today . Run \'app\' failed because following error :

Error:(1         


        
7条回答
  •  野的像风
    2021-02-05 10:58

    android-apt and hence using apt has been deprecated since Android Studio 2.2.
    Following the android-apt migration guide, instead add the following to your build.gradle:

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
        annotationProcessor 'com.android.databinding:compiler:2.3.0'
    }
    

    If you are using Kolin, instead use:

    apply plugin: 'kotlin-kapt'
    
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0' // use same gradle version!
        kapt 'com.android.databinding:compiler:2.3.0'
    }
    

提交回复
热议问题