相关疑难解决方法(0)

如何摆脱增量注释处理请求的警告?

我刚刚开始使用android开发并尝试使用Room库。从昨天开始我就面临着这个警告信息

w:[kapt]请求了增量注释处理,但是由于以下处理器不是增量处理器,因此禁用了支持:androidx.lifecycle.LifecycleProcessor(NON_INCREMENTAL),androidx.room.RoomProcessor(NON_INCREMENTAL)。

我已经尝试研究和修复,但无法避免此错误,这是我的grale.build文件。请提出建议/建议我在做什么错。

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.2"
    defaultConfig {
        applicationId "ps.room.bookkeeper"
        minSdkVersion 15
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation":"$projectDir/schemas".toString()]
            }
        }    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.core:core-ktx:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    // …
Run Code Online (Sandbox Code Playgroud)

android android-lifecycle android-room

73
推荐指数
8
解决办法
2万
查看次数

标签 统计

android ×1

android-lifecycle ×1

android-room ×1