Android studio 报错:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
Run Code Online (Sandbox Code Playgroud)
我想在我的项目 Kotlin Coroutines 中添加并将其与 Room 数据库一起使用。但是在添加了所有库之后,我收到了这个错误。这是来自编译器的所有信息。
我已经确定,这是因为注释@Database。如果我删除此注释,则不会出现错误,但 Room 也无法正常工作。
我的gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
//apply plugin: 'androidx.navigation.safeargs'
kotlin {
experimental {
coroutines 'enable'
}
}
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.bestcred.coursetthree"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled …Run Code Online (Sandbox Code Playgroud)