Kotlin 为什么dagger需要提供我不需要的实体';我不想提供它们?
我有两个模块-Kotlin 为什么dagger需要提供我不需要的实体';我不想提供它们?,kotlin,dagger,Kotlin,Dagger,我有两个模块-core和auth。在auth模块中,我尝试将Google登录集成到Firebase。所有依赖项都正确解析,但不是GoogleSignInClient。我不想用dagger为这个实体提供这个客户。我只想在这门课上使用它。但dagger告诉我一个错误: class file for com.google.android.gms.auth.api.signin.GoogleSignInClient not found Consult the following stack tr
core
和auth
。在auth模块中,我尝试将Google登录集成到Firebase。所有依赖项都正确解析,但不是GoogleSignInClient。我不想用dagger为这个实体提供这个客户。我只想在这门课上使用它。但dagger告诉我一个错误:
class file for com.google.android.gms.auth.api.signin.GoogleSignInClient not found
Consult the following stack trace for details.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.android.gms.auth.api.signin.GoogleSignInClient not found
e: D:\Projects\<project path>\build\tmp\kapt3\stubs\internalProductionDebug\<class path>\di\components\AppComponent.java: error:
[ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
未找到com.google.android.gms.auth.api.signin.GoogleSignInClient的类文件
有关详细信息,请参阅以下堆栈跟踪。
com.sun.tools.javac.code.Symbol$CompletionFailure:找不到com.google.android.gms.auth.api.signin.GoogleSignInClient的类文件
e:D:\Projects\\build\tmp\kapt3\stubs\internalProductionDebug\\di\components\AppComponent.java:错误:
[ComponentProcessor:MiscError]dagger.internal.codegen.ComponentProcessor无法处理此接口,因为无法解析其所有依赖项。检查编译错误或生成代码的循环依赖关系。
不幸的是,这不是匕首问题。当您在gradle中错误地使用
api
和implementation
时,使用几个Android模块就会发生这种情况
我不知道为什么,但是当我在Gradle中修复了我的依赖项时,所有这些都开始工作了 如果你确定不需要客户端作为依赖项,这可能是一些Gradle和Kapt缓存的问题。你能发布dagger组件的代码吗?请检查
GoogleSignInClient
是否未在构造函数、方法参数或标有@Inject
注释的文件声明中使用。@tynn对于这种情况,我们有什么解决方法吗?有时它足以杀死Gradle deamon。有一次,我从电脑上删除了所有与Gradle和Android Studio相关的内容。你必须弄清楚它被用在哪里以及为什么。