gpt4 book ai didi

kotlin - 为什么 Dagger 需要提供我不想提供的实体?

转载 作者:行者123 更新时间:2023-12-02 12:53:47 25 4
gpt4 key购买 nike

我有两个模块 - coreauth .在身份验证模块中,我正在尝试将 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.

最佳答案

不幸的是,这不是 Dagger 问题。当您使用 api 时,使用多个 Android 模块会发生这种情况和 implementation在 gradle 中不正确。

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

关于kotlin - 为什么 Dagger 需要提供我不想提供的实体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53333767/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com