kotlin - 为什么匕首需要提供我不想提供的实体?
问题描述
我有两个模块 -core
和auth
. 在身份验证模块中,我正在尝试将 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.
解决方案
不幸的是,这不是匕首问题。当您错误地使用api
和使用implementation
gradle 时,使用多个 Android 模块会发生这种情况。
我不知道为什么,但是当我在 Gradle 中修复我的依赖项时 - 一切都开始工作了。
推荐阅读
- maven - Maven Parallel Build Sequence 一些模块
- java - Spring 框架:当您将 Java bean 注入另一个 Java bean 但它们具有不同的范围时会发生什么
- linux - 如何使用 ssh 从在 docker 容器中运行的 jenkins 连接到在 docker 容器中运行的远程主机
- android - 使用 ScrollView 时,RelativeLayout 按钮消失
- javascript - vanlla javascript - 为什么粒子痛风没有被绘制
- c++ - 将内存预分配给对齐的字节,如 c 或 c++ 中的对齐分配
- javascript - 仅在来自 axios 的请求的循环完成后才执行代码块
- ubuntu-18.04 - Zabbix代理无法连接到Zabbix5.0服务器
- c - 为结构内的变量动态分配内存,如 int、double 等
- c# - Xamarin.Forms ImageCell 不显示图像版本 4.7.0.xx