Android Studio升级到最新版3.0 Canary 8后,当使用到注解时,报了如下错误:
Error:Execution failed for task ':app:javaPreCompileDebug'. > 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

解决办法:在Gradle中添加如下代码
android {
    ...
    
    defaultConfig {
        ...

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

且保证多module只有一个依赖了butterknife注解库

 

相关文章:

  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-13
  • 2021-06-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2021-12-14
  • 2021-12-10
  • 2021-10-25
  • 2021-08-09
相关资源
相似解决方案