androidstudio3.0使用butterknife报错,配置javaCompileOptions无效的问题

在AndroidStudio3.0中引入Butter Knife时会报错:

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.

给出的解决方案是:在使用ButterKnife的Module的build文件中使用:android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true

但是在重新编译之后还是报了该错误,几经周折,才发现在有其他的module引用了该module,于是在引用了该module的module的build文件都添加了android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true

再次编译,问题解决。

你可能感兴趣的:(androidstudio3.0使用butterknife报错,配置javaCompileOptions无效的问题)