HiltExpected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin?

Posted guangdeshishe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HiltExpected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin?相关的知识,希望对你有一定的参考价值。

问题:

android Studio在接入Hilt的时候,编译时总是提示Expected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin?

原因:

因为项目之前接入了ARouter,在build.gradle中配置了自定义参数如下:

javaCompileOptions 
	annotationProcessorOptions 
		arguments = [AROUTER_MODULE_NAME: project.getName()]
	

解决办法:

arguments =改成arguments +=即可,如下:

javaCompileOptions 
	annotationProcessorOptions 
		arguments += [AROUTER_MODULE_NAME: project.getName()]
	

以上是关于HiltExpected @AndroidEntryPoint to have a value. Did you forget to apply the Gradle Plugin?的主要内容,如果未能解决你的问题,请参考以下文章