我应该在 Kotlin 项目中将所有 annotationProcessor 更改为 kapt
Should I change all annotationProcessor to kapt in Kotlin project
我注意到我必须使用 kapt
而不是 annotationProcessor
才能使 Dagger 2
在我的 Kotlin 项目中正常工作。我是否必须对所有库(特别是 Glide
和 Room
)执行相同的操作?
可以,建议这样做。文档指出:
If you previously used the Android support for annotation processors, replace usages of the annotationProcessor
configuration with kapt
. If your project contains Java classes, kapt
will also take care of them.
我注意到我必须使用 kapt
而不是 annotationProcessor
才能使 Dagger 2
在我的 Kotlin 项目中正常工作。我是否必须对所有库(特别是 Glide
和 Room
)执行相同的操作?
可以,建议这样做。文档指出:
If you previously used the Android support for annotation processors, replace usages of the
annotationProcessor
configuration withkapt
. If your project contains Java classes,kapt
will also take care of them.