How to get rid of Incremental annotation processing requested warning?

后端 未结 13 959
一生所求
一生所求 2020-12-04 08:27

I have just started using android development and trying to use Room library. Since yesterday I am facing this warning message

w: [kapt] Incremental a

13条回答
  •  情话喂你
    2020-12-04 08:49

    Here is a list of things you can do to fix this and significantly decrease your build times while you're at it.

    In your build.gradle (module) file:

    android {
        ...
        defaultConfig {
            ...
            kapt {
                arguments {
                     arg("room.schemaLocation", "$projectDir/schemas".toString())
                     arg("room.incremental", "true")
                     arg("room.expandProjection", "true")
                }
            }
        }
        ...
    }
    

    In your gradle.properties file:

    kapt.incremental.apt=true            // enabled by default on 1.3.50+
    kapt.use.worker.api=true             // faster builds
    kapt.include.compile.classpath=false // near instant builds when there are few changes
    
    android.databinding.incremental=true
    android.lifecycleProcessor.incremental=true
    //add your specific library if it supports incremental kapt 
    

提交回复
热议问题