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注解庫