Android Studio fails to generate databinding after 3.1.0 update

前端 未结 20 2921
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-15 02:40

This morning I made an update to android studio from 3.0.1 to 3.1.0. After updating the gradle to latest version I still get build error regarding

20条回答
  •  爱一瞬间的悲伤
    2020-12-15 03:16

    This one is a very tricky bug with android studio and databinding! I had to test all this proposed solutions and some more for an entire day to finally make the databinding compile at least.

    So I had to disable all databindind settings in gradle.properties file, just comment these lines or delete them:

    android.databinding.enableV2 = true
    android.enableExperimentalFeatureDatabinding = true
    

    remove buildToolsVersion from build.gradle and have the following sdk versions:

    compileSdkVersion 27
    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    

    Plus a couple more clean/rebuild invalidate caches and restart, and it FINALLY compiled. AS engineers are great at creating bugs!

提交回复
热议问题