首页 > 解决方案 > 为什么匕首需要提供我不想提供的实体?

问题描述

我有两个模块 -coreauth. 在身份验证模块中,我正在尝试将 Google 登录集成到 Firebase。所有依赖项都正确解析,但不是 GoogleSignInClient。我不想为这个实体使用 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.

标签: kotlindagger

解决方案


不幸的是,这不是匕首问题。当您错误地使用api和使用implementationgradle 时,使用多个 Android 模块会发生这种情况。

我不知道为什么,但是当我在 Gradle 中修复我的依赖项时 - 一切都开始工作了。


推荐阅读