Annotation processors must be explicitly declared now

后端 未结 5 1970
[愿得一人]
[愿得一人] 2021-02-01 14:16
Error:Execution failed for task \':laMusique2May2016:javaPreCompileRelease\'.
> Annotation processors must be explicitly declared now.  The following dependencies on          


        
相关标签:
5条回答
  • 2021-02-01 14:55

    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

    0 讨论(0)
  • 2021-02-01 15:05

    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.

    0 讨论(0)
  • 2021-02-01 15:08

    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

    0 讨论(0)
  • 2021-02-01 15:12

    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'
    
    0 讨论(0)
  • 2021-02-01 15:13

    For me, this issue happened because jitpack wasn't placed as the last entry in root grade.

    allprojects {
        repositories {
            // ... other repositories
            maven { url "https://jitpack.io" }
        }
    }
    
    

    The solution was taken from @hotchemi comment in https://github.com/permissions-dispatcher/PermissionsDispatcher/issues/535#issuecomment-432190926

    0 讨论(0)
提交回复
热议问题