简体   繁体   English

在Android Studio中未生成Dagger 2组件

[英]Dagger 2 Component not generated in android studio

dagger2 component not generated in my MainActivity class. 我的MainActivity类中未生成dagger2组件。 i write is line in my Gradle project file: 我在Gradle项目文件中写了一行:

classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

and also this lines in my Gradle module: 并且这行在我的Gradle模块中:

annotationProcessor 'com.google.dagger:dagger-compiler:2.17'
compileOnly 'org.glassfish:javax.annotation:10.0-b28'
implementation "com.google.dagger:dagger:2.17"

and sync my project, but still not working. 并同步我的项目,但仍然无法正常工作。

for Dagger components to be generated, you need to do a Build of your project. 为了生成Dagger组件,您需要对项目进行Build Doing a Clean will remove all dagger generated components and Build will recreate these components 进行Clean将删除所有由匕首生成的组件,并且Build将重新创建这些组件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM