我应该将所有注释处理器更改为Kotlin项目中的kapt吗 [英] Should I change all annotationProcessor to kapt in Kotlin project

查看:86
本文介绍了我应该将所有注释处理器更改为Kotlin项目中的kapt吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到我必须使用kapt而不是annotationProcessor来使Dagger 2在我的Kotlin项目中正常工作.我是否必须对所有库(特别是GlideRoom)执行相同的操作?

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 with kapt. If your project contains Java classes, kapt will also take care of them.

阅读有关使用kapt的更多信息

这篇关于我应该将所有注释处理器更改为Kotlin项目中的kapt吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆