時々、GitHub でコードを作成して見てみると、AS を 3.0 にアップグレードした後、次のようなエラーが頻繁に発生しました。
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 (com.jakewharton:butterknife:7.0.1)
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.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.
それはおそらく次のことを意味します:
注釈プロセッサは明示的に宣言する必要があります。コンパイル クラスパスの次の依存関係には、アノテーション プロセッサが含まれていることが判明しました。これらをアノテーションプロセッサ構成に追加してください。
対処する:
アプリのビルド android { ... defaultConfig { ... //次の構成を追加します
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
}