我应该将所有注释处理器更改为Kotlin项目中的kapt吗 [英] Should I change all annotationProcessor to kapt in Kotlin project
本文介绍了我应该将所有注释处理器更改为Kotlin项目中的kapt吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注意到我必须使用kapt
而不是annotationProcessor
来使Dagger 2
在我的Kotlin项目中正常工作.我是否必须对所有库(特别是Glide
和Room
)执行相同的操作?
I noticed that I have to use kapt
instead of annotationProcessor
to make Dagger 2
work properly in my Kotlin project. Do I have to do the same to all the libraries (specifically Glide
and Room
)?
推荐答案
是的,建议这样做.该文档指出:
Yes, it is recommended to do so. The documentation stated:
如果您以前使用Android支持注释处理器,则将
annotationProcessor
配置的用法替换为kapt
.如果您的项目包含Java类,则kapt
也会照顾它们.
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.
这篇关于我应该将所有注释处理器更改为Kotlin项目中的kapt吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文