Ошибка построения Dagger и Kapt
У меня появилась проблема с Dagger и Kapt. Проект отказывается компилироваться.
build.gradle.kts(level Project)
buildscript {
val kotlinVersion = "1.3.70"
repositories {
google()
jcenter()
maven {
url = uri("https://jitpack.io")
}
}
dependencies {
classpath("com.android.tools.build:gradle:3.6.1")
classpath(kotlin("gradle-plugin", kotlinVersion))
}
}
allprojects {
repositories {
google()
jcenter()
}
}
tasks {
val clean by registering(Delete::class) {
delete(buildDir)
}
}
build.gradle.kts(level Application)
import org.jetbrains.kotlin.config.KotlinCompilerVersion
plugins {
id("com.android.application")
kotlin("android")
kotlin("android.extensions")
kotlin("kapt")
}
android {
compileSdkVersion(29)
dataBinding {
isEnabled = true
}
kapt {
generateStubs = true
correctErrorTypes = true
}
defaultConfig {
applicationId = "com.lifeindarkness.daggertest"
minSdkVersion(21)
targetSdkVersion(29)
versionCode = 1
versionName ="${(versionCode ?: 1) / 10}"
multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
implementation(kotlin("stdlib-jdk7", KotlinCompilerVersion.VERSION))
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.core:core-ktx:1.2.0")
implementation("com.google.android.material:material:1.2.0-alpha05")
implementation("net.cachapa.expandablelayout:expandablelayout:2.9.2")
implementation("androidx.constraintlayout:constraintlayout:2.0.0-beta4")
// coroutines
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.3")
implementation("org.koin:koin-android:2.1.3")
implementation("org.koin:koin-core:2.1.3")
implementation("org.koin:koin-android-viewmodel:2.1.3")
implementation("de.hdodenhof:circleimageview:3.1.0")
implementation("com.squareup.picasso:picasso:2.71828")
implementation("androidx.fragment:fragment-ktx:1.2.2")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.2.0")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0")
implementation("com.google.code.gson:gson:2.8.6")
implementation("androidx.biometric:biometric:1.0.1")
implementation("androidx.multidex:multidex:2.0.1")
testImplementation("junit:junit:4.12")
testImplementation("androidx.test:core:1.2.0")
implementation("com.google.dagger:dagger:2.26")
kapt("com.google.dagger:dagger-compiler:2.17")
implementation("com.google.dagger:dagger-android:2.26")
implementation("com.google.dagger:dagger-android-support:2.26")
kapt("com.google.dagger:dagger-android-processor:2.16")
kapt("com.android.databinding:compiler:3.1.4")
}
Вывод Build Gradle
Executing tasks: [assemble] in project /home/danil/AndroidStudioProjects/daggertest
Gradle Daemon started in 2 s 141 ms
> Configure project :app
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
'kapt.generateStubs' is not used by the 'kotlin-kapt' plugin
> Task :app:preBuild UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :app:compileDebugAidl NO-SOURCE
> Task :app:generateDebugBuildConfig
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:prepareLintJar
> Task :app:prepareLintJarForPublish
> Task :app:generateDebugSources
> Task :app:dataBindingExportBuildInfoDebug
> Task :app:dataBindingMergeDependencyArtifactsDebug
> Task :app:dataBindingMergeGenClassesDebug
> Task :app:generateDebugResValues
> Task :app:generateDebugResources
> Task :app:mergeDebugResources
> Task :app:dataBindingGenBaseClassesDebug
> Task :app:dataBindingExportFeaturePackageIdsDebug
> Task :app:mainApkListPersistenceDebug
> Task :app:createDebugCompatibleScreenManifests
> Task :app:extractDeepLinksDebug
> Task :app:processDebugManifest
> Task :app:processDebugResources
> Task :app:kaptGenerateStubsDebugKotlin
> Task :app:mergeDebugShaders
> Task :app:compileDebugShaders
> Task :app:generateDebugAssets
> Task :app:mergeDebugAssets
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:kaptDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (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 2m 11s
20 actionable tasks: 20 executed