相关疑难解决方法(0)

执行 org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang.reflect.InvocationTargetException 时发生故障(无错误消息)

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)

android kotlin android-room kotlin-coroutines

63
推荐指数
8
解决办法
3万
查看次数

标签 统计

android ×1

android-room ×1

kotlin ×1

kotlin-coroutines ×1