Annotation processors must be explicitly declared now

Even i had the same problem and finally i solved my problem by adding this to app level gradle file

android{
....
    defaultConfig{
....
    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath true
        }
    }
}
buildTypes {
...
}

hope its solved someone's problem


You should explicitly add annotation processors in gradle. Putting the following in your gradle dependencies should fix it:

annotationProcessor 'com.google.auto.value:auto-value:1.1'

However, as others have already mentioned, you should probably figure out which of your existing dependencies was using auto-value to assert whether or not you really need it. Annotation processors ultimately slow down your build time so don't include it if it's unnecessary.


Adding annotationProcessor dependencies not work for me, instead I drop this line inside build.gradle at arbitrary places works:

android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true


Annotation processors can be declared with annotationProcessor instead of implementation/compile like we used to declare earlier.

implementation 'com.google.auto.value:auto-value:1.1' 

compile 'com.google.auto.value:auto-value:1.1' 

Should be replaced with

annotationProcessor 'com.google.auto.value:auto-value:1.1'

Tags:

Java

Android