- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Android Studio 中构建我的项目时,我收到了这个信息不多的错误。我已经尝试了 stackoverflow 中的所有方法,但没有任何效果。
任务“:app:kaptDebugKotlin”执行失败。
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecutionjava.lang.reflect.InvocationTargetException (no error message)
我的应用程序等级:
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
configurations.all {
resolutionStrategy { force 'androidx.core:core-ktx:1.6.0' }
}
applicationId "com.nenad.favrecipes"
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
android {
buildFeatures {
dataBinding true
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" //1.5.21
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
// RxJava
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'io.reactivex.rxjava3:rxjava:3.0.0'
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-scalars:2.9.0"
implementation "com.squareup.retrofit2:converter-moshi:2.9.0"
implementation "com.squareup.okhttp3:okhttp:4.9.1"
implementation "com.squareup.okhttp3:logging-interceptor:4.9.1"
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.2.1"
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
//shimmering RV
implementation 'com.facebook.shimmer:shimmer:0.5.0'
implementation 'com.todkars:shimmer-recyclerview:0.4.1'
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'com.google.dagger:hilt-android:2.40.5'
kapt 'com.google.dagger:hilt-compiler:2.40.5'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// DataStore
implementation "androidx.datastore:datastore-preferences:1.0.0"
implementation "androidx.datastore:datastore:1.0.0"
implementation("androidx.fragment:fragment-ktx:1.3.0")
def room_version = '2.3.0'
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
}
kapt {
correctErrorTypes true
}
}
我的项目gradle:
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3' //4.1.3
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.40.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id "org.jetbrains.kotlin.android" version "1.4.20" apply false
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
最佳答案
更改Android Studio的JDK版本试试转到文件-> 项目结构-> SDK 位置-> 单击 Gradle 设置
关于android - 任务 ':app:kaptDebugKotlin' 执行失败。 > 执行 org.jetbrains.kotlin.gradle.internal.KaptExecution 时发生故障,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71135167/
在为Room启用kapt后,我的Android构建一直失败,但是据我所知,我以正确的方式配置了所有内容,但我似乎真的找不到问题。 我的数据库类: 债务数据库 package com.eliasball
我在项目构建过程中遇到了下一个问题:构建过程停留在 app:kaptDebugKotlin任务。 我的根项目build.gradle : apply plugin: "kotlin" buildscr
在 Android Studio 上进行构建时出现此错误 任务 ':app:kaptDebugKotlin' 执行失败。 A failure occurred while executing org.
我该如何解决这个问题?我没有添加任何新库或以任何方式修改 gradles,我只是在我的应用程序中添加了一些 Kotlin 类,它们是 Realm 对象,然后继续运行该应用程序并弹出此错误,感谢您的帮助
今天我正在尝试构建一个 Android 项目,但出现以下错误。 我必须找到一种方法来解决这个问题。 有人知道发生了什么吗? [ERROR] [org.gradle.internal.buildeven
我对使用 cmd 构建项目有疑问。当我使用 android studio 构建项目时没问题,但是当我清理项目然后使用 cmd 构建时出现错误 这个命令: gradlew assembleDebug 此
当我尝试启动我的应用程序时出现无法解决的问题。我正在使用 Room 数据库和数据绑定(bind)。 我发现问题源于我的数据库类,但似乎找不到问题的解决方案 @Database(entities = [
尝试在我的项目 ( https://github.com/guger/MoneyBook ) 上运行命令 ./gradlew :data:test 时,我遇到了 IllegalStateExcepti
我是使用 Kotlin 并尝试使用 Dagger2 进行设置的新手,我看过一些示例,但似乎没有一个适合我。 我不断收到这个 Error:Execution failed for task ':app:
添加了刀柄依赖项: Build.gradle(项目) def hilt_version = "2.38.1" classpath "com.google.dagger:hilt-android-gra
我正在做一个关于 Android 工作室的小项目。我目前正在为 m1 mac 使用金丝雀版本的 android studio。当我尝试实现房间时,出现以下错误: Execution failed fo
我是 Android 开发的新手,也许这很明显是我所缺少的。我已从 i7 切换到 Apple M1,在构建项目时,出现错误: Execution failed for task ':app:kaptD
请帮助我几天来我一直在盯着同样的错误。我正在运行 android studio 2.3(我在 android studio 3.0 上也遇到过这个问题)。 这是我的消息中显示的内容: Error:Ex
所以,我试图创建一个例子,灵感来自 GithubBrowserSample与 Kotlin 。我已成功迁移到 kotlin 代码,但我的 ApplicationComponent.kt 出现错误。 E
我遇到了以下错误,找不到解决方案。 Execution failed for task ':app:kaptDebugKotlin'. > A failure occurred while execu
刚刚更新到 Mac 上的 Android Studio Arctic Fox,在修复和更新了所有 Gradle 设置以使其与 Gradle 7.0 以及这个新版本要求我做的任何事情之后,我现在在构建我
在 Android Studio 中构建我的项目时,我收到了这个信息不多的错误。我已经尝试了 stackoverflow 中的所有方法,但没有任何效果。 任务“:app:kaptDebugKotlin
任务“:common:kaptDebugKotlin”执行失败。 A failure occurred while executing org.jetbrains.kotlin.gradle.inte
任务“:common:kaptDebugKotlin”执行失败。 A failure occurred while executing org.jetbrains.kotlin.gradle.inte
我是一名优秀的程序员,十分优秀!