android - 编译数据绑定时出错:-任务“:app:kaptDebugKotlin”执行失败
问题描述
大家好,我在android中进行数据绑定时遇到了一个错误
运行代码时显示以下错误:org.gradle.api.tasks.TaskExecutionException:任务':app:kaptDebugKotlin'的执行失败
这在破坏项目时显示为错误。
这些是我的项目的详细信息,我无法理解我的 gradle 代码有什么问题
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.snake.implimetations"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
android {
dataBinding {
enabled = true
}
}
}
dependencies {
def lifecycle_version = "1.+"
implementation fileTree(dir: 'libs', include: ['*.jar'])
//support
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
// database
implementation 'androidx.room:room-rxjava2:2.1.0'
kapt 'androidx.room:room-compiler:2.1.0'
// font
implementation "uk.co.chrisjenx:calligraphy:$rootProject.calligraphyVersion"
//viewModel and LiveData
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
kapt 'androidx.lifecycle:lifecycle-compiler:2.0.0'
// parser
implementation "com.google.code.gson:gson:$rootProject.gsonVersion"
// Dagger 2
implementation 'com.google.dagger:dagger-android-support:2.17'
implementation 'com.google.dagger:dagger:2.17'
kapt "com.google.dagger:dagger-compiler:2.17"
kapt "com.google.dagger:dagger-android-processor:2.17"
// network
implementation "com.amitshekhar.android:rx2-android-networking:$rootProject.rx2FastAndroidNetworking"
// reactive
implementation "io.reactivex.rxjava2:rxjava:$rootProject.rxjava2Version"
implementation "io.reactivex.rxjava2:rxandroid:$rootProject.rxandroidVersion"
//htttp
implementation('org.apache.httpcomponents:httpmime:4.3.6') {
exclude module: 'httpclient'
}
implementation 'org.apache.httpcomponents:httpclient-android:4.3.5'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'org.jetbrains:annotations:15.0'
}
解决方案
推荐阅读
- javascript - 无法对公牛队列进行速率限制
- docker - 在容器启动时安装 Nano?
- c++ - 是否有 C++20 方法来检测类型是否是仅使用概念和 requires() 的模板的实例化?
- ios - 如何以实际比例打印硬拷贝,例如 1" = 1"
- python - Python DataFrame:Pandas groupby 行到列?
- blockchain - chainlink 是否有可靠的方法来验证存储在 IPFS 上的哈希后面的文件的大小/格式?
- android - EditText 未显示在预览屏幕中
- java - 如何避免在 Java 中重复 for 循环?
- r - How can I merge row with similar value in column, to get unique value in another column in R
- node.js - Unable to connect to Docker container from Windows host machine