【错误记录】Android Studio 编译时 lint 检查报错 ( WARNING: DSL element ‘android.dataBinding.enabled‘ is obsolet )





一、报错信息



在 Android Studio 中的 Terminal 面板中 , 执行

gradlew :app:lintDebug

命令 ,

在这里插入图片描述

进行 lint 检查 , 测试代码结构 , 报如下错误 :

Y:\002_WorkSpace\001_AS\SVG>gradlew :app:lintDebug
Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :app
WARNING: DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'.
It will be removed in version 5.0 of the Android Gradle plugin.

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:lintDebug'.
> Could not resolve all artifacts for configuration ':app:debugUnitTestCompileClasspath'.
   > Could not resolve junit:junit:4.+.
     Required by:
         project :app
      > Failed to list versions for junit:junit.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/junit/junit/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/junit/junit/maven-metadata.xml'.
               > org.apache.http.client.ClientProtocolException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s

在这里插入图片描述





二、解决方案



将 " build.gradle # android " 中的

android {
    dataBinding {
        enabled = true
    }
}

配置 , 修改为

android {
    buildFeatures {
        dataBinding = true
    }
}
  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值