Kotlin 开发错误集合

1.ERROR: Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

方案1-修改配置后执行编译

compileSdkVersion, buildToolsVersion, targetSdkVersion从31改成30

 方案二

打开build-tools\31.0.0

d8.bat的文件,这是批处理文件,重命名d8.bat为dx.bat

打开build-tools\31.0.0\lib

将d8.jar重命名为dx.jar

2. AAPT: error: resource string/appbar_scrolling_view_behavior

AAPT: error: attribute defaultNavHost

AAPT: error: attribute layout_constraintBottom_toBottomOf

AAPT: error: attribute layout_constraintLeft_toLeftOf

AAPT: error: attribute layout_constraintRight_toRightOf

解决方案

build.gradle里面添加依赖 / 然后重新加载依赖

implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
dependencies {
    .......
    implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
}

 3.AVD New_Device is already running

 解决方案:

删除.android/avd/New_Device_4_API_29.avd/目录下面所有以.lock结尾的文件

 

java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.7.0-runtime (androidx.core:core:1.7.0) and support-compat-28.0.0-runtime (com.android.support:support-compat:28.0.0)

解决方案

gradle.properties 文件下添加如下配置

:app:kaptDebugKotlin

java.lang.reflect.InvocationTargetException (no error message)

 解决方案

gradle.properties 文件下添加如下配置

kapt.incremental.apt = false
kapt.include.compile.classpath=false
kapt.use.worker.api=false

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

️ 邪神

你自己看着办,你喜欢打赏我就赏

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值