【问题标题】:Facing error in Dagger while build the application构建应用程序时在 Dagger 中遇到错误
【发布时间】:2020-02-10 12:18:51
【问题描述】:

在构建 Android 应用时遇到 Gradle 错误。

以下错误:

程序类型已经存在:dagger.Reusable

我们将不胜感激任何形式的帮助。

应用程序/Gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation project(':transport')
    implementation 'com.android.support:appcompat-v7:23.3.0'
    compile files('libs/org.eclipse.paho.android.service-1.1.1.jar')
    compile files('libs/org.eclipse.paho.client.mqttv3-1.1.1.jar')
    compile 'com.google.protobuf:protobuf-java:3.2.0'
    implementation ('com.google.dagger:dagger:2.23'){
        exclude group: "javax.inject", module: "javax.inject"
    }
    annotationProcessor ("com.google.dagger:dagger-compiler:2.23"){
//        exclude group: "javax.inject", module: "javax.inject"
    }
}

【问题讨论】:

    标签: dagger-2 dagger


    【解决方案1】:

    您不应该在 implementation 范围内使用 Dagger 2 依赖项,就像在您的 sn-p 中所做的那样。

    有问题的线路:

    implementation ('com.google.dagger:dagger:2.23'){
            exclude group: "javax.inject", module: "javax.inject"
    }
    

    见:https://github.com/google/dagger/issues/1179

    【讨论】:

      猜你喜欢
      • 2021-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-14
      • 2019-02-02
      • 2020-04-21
      • 2023-03-23
      • 2016-09-23
      相关资源
      最近更新 更多