[Bug] Android Studio uses butterknife to report errors

Reprinted from: https://blog.csdn.net/huangxiaoguo1/article/details/78111857

Error:

Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - butterknife-7.0.1.jar
  Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior.  Note that this option is deprecated and will be removed in the future.

Solution:

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

Add under defaultConfig{}:

        javaCompileOptions {
            annotationProcessorOptions {
                includeCompileClasspath = true  
            }
        }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325875008&siteId=291194637