【错误记录】Android Studio 编译时 lint 检查报错 ( WARNING: DSL element ‘android.dataBinding.enabled‘ is obsolet )
2023-06-13 09:18:05 时间
文章目录
一、报错信息
在 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
}
}
相关文章
- 74款android开机动画,修改Android系统开机动画
- strictmode android,(十三)Android 性能优化 StrictMode
- android 安装p12证书,如何在Android中使用p12证书(客户端证书)
- android toast全屏,Android Toast实现全屏显示
- Android 编译_android线程
- 【错误记录】Android Studio 中 DataBinding 布局报错 ( Resources$NotFoundException: String resource ID #0xd )
- 【错误记录】Flutter / Android 报错 ( AAPT: error: attribute android:requestLegacyExternalStorage not found )
- 【错误记录】Android Studio 编译信息输出乱码
- 【错误记录】Android Studio 编译报错 ( Invalid Gradle JDK configuration found )
- 【错误记录】Android Studio 编译报错 ( cannot open this project, please retry with version 4.2 or newer. )
- 【错误记录】Android Studio 编译报错 ( AppCompat does not support the current theme features )
- 【错误记录】Android Studio 编译报错 ( Could not find com.android.tools.build:gradle:4.2.1. )
- 【错误记录】Android Studio 配置 AspectJ 报错 ( Failed to create Jar file C:xxxaspectjtools-1.8.10.jar. )
- 【Android 逆向】Android 权限 ( Android 逆向中使用的 android.permission 权限 | Android 系统中的 Linux 用户权限 )
- 【错误记录】记录 Android 命令行执行 Java 程序中出现的错误 ( dx 打包 PC 可执行文件报错 | dalvik 命令执行 kotlin 编译的 dex 文件报错 )
- 【错误记录】Android Gradle 配置报错 ( gradle.properties 配置到 BuildConfig 中需要注意类型转换 | 位置: 类 BuildConfig )
- 【错误记录】未安装该应用 ( 在 Android 12 之后 组件设置 android:exported=“false“ 属性 )
- 【错误记录】编译 Android 版本的 ijkplayer 报错 ( You must define ANDROID_NDK before starting. | 下载指定版本 NDK )
- 【错误记录】编译 Android 版本的 ijkplayer 报错 ( ./init-android.sh: 第 37 行: cd: android/contrib/: 没有那个文件或目录 )
- 【错误记录】Android Studio 编译报错 ( AAPT: error: failed to read PNG signature: file does not start with PN )
- 【错误记录】Android Studio 编译报错 ( The minCompileSdk (31) specified in a dependency‘s AAR metadata (META- )
- 【错误记录】Android Studio 真机运行 Apk 应用报错 ( The application could not be installed: SHELL_UNRESPONSIVE )