Android 重复类重复类 javax.inject.Inject

如何解决Android 重复类重复类 javax.inject.Inject

我将一个 android studio 项目克隆到另一台 PC。在那之后,我开始收到一堆错误。

Duplicate class javax.inject.Inject found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)
Duplicate class javax.inject.Named found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)
Duplicate class javax.inject.Provider found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)
Duplicate class javax.inject.Qualifier found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)
Duplicate class javax.inject.Scope found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)
Duplicate class javax.inject.Singleton found in modules javax.inject-1.jar (javax.inject:javax.inject:1) and sisu-inject-bean-1.4.2.jar (org.sonatype.sisu:sisu-inject-bean:1.4.2)

这些类存在于两个单独的 jar 中(javax.inject-1.jarsisu-inject-bean-1.4.2.jar)。所以我尝试删除其中一个依赖项,但失败了,Studio 只是在缓存无效并重新启动后将它们添加回来。

我无法提升 gradle 的版本,因为有一个存储库(第 3 方)不能与高于 gradle-5.1.1 的 gradle 版本一起使用

安卓工作室版本:4.1.2
构建工具版本为 classpath 'com.android.tools.build:gradle:3.4.2'
JDK 1.8

而且我的依赖项部分中也没有这些库。那些 jars 刚刚添加到我的后台构建中(不知道它是如何工作的)。

dependencies {
    compile fileTree(include: ['*.jar'],dir: 'libs')
    compile files('libs/hoinsdk.jar')
    androidTestImplementation 'com.squareup.okhttp:mockwebserver:1.3.0'
    androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.2',{
        exclude group: 'com.android.support',module: 'support-annotations'
    })

    androidTestCompile('com.android.support.test.espresso:espresso-core:3.0.2',module: 'support-annotations'
    })

    androidTestImplementation 'com.android.support.test.espresso:espresso-web:3.0.2'
    androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
    androidTestCompile('com.android.support.test.espresso:espresso-contrib:3.0.2') {
        exclude group: 'com.android.support',module: 'appcompat'
        exclude group: 'com.android.support',module: 'support-v4'
        exclude group: 'com.android.support',module: 'support-annotations'
        exclude module: 'recyclerview-v7'
    }

    // Does not matter if we have this part or not. The error is still the same :(
    implementation("org.sonatype.sisu:sisu-inject-bean:1.4.2",{
        exclude group: 'org.sonatype.sisu',module: 'app'
    })
    // ---------------------------------------------------------------

    androidTestImplementation('com.android.support.test.espresso:espresso-intents:2.2.2')
    androidTestCompile files('libs/hoinsdk.jar')
    testCompile files('libs/hoinsdk.jar')
    compile files('libs/sunmiscan.jar')

    implementation fileTree(include: ['*.arr'],dir: 'libs')
    implementation(name: 'PayLib-release-1.3.14',ext: 'aar')

    implementation('com.github.bumptech.glide:okhttp3-integration:1.4.0') {
        exclude group: 'glide-parent'
    }
    implementation 'com.ru.ingenico.pclextended:Arcus2AndroidExtended-debug:@aar'
    implementation files('libs/usdk_api_aidl_v2.0.0.20180130.jar')
    implementation files('libs/usdk_api_aidl_v2.0.0.20180130.jar')
    implementation 'com.warrenstrange:googleauth:1.1.1'
    implementation 'commons-io:commons-io:2.4'
    implementation 'com.squareup.okhttp3:okhttp:4.6.0'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.6.0'

    api 'com.google.dagger:dagger:2.25.4'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.25.4'

    testCompile 'com.warrenstrange:googleauth:1.1.1'
    androidTestCompile 'commons-io:commons-io:2.4'
    implementation 'com.warrenstrange:googleauth:1.1.1'
    implementation 'commons-io:commons-io:2.4'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.9.0'
    implementation 'ru.appex:mcash-sdk:6.0'
    implementation 'com.googlecode.json-simple:json-simple:1.1.1'
    implementation 'com.google.code.gson:gson:2.8.4'
    implementation 'junit:junit:4.12'
    implementation 'org.apache.commons:commons-lang3:3.6'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'commons-codec:commons-codec:1.10'
    implementation 'com.journeyapps:zxing-android-embedded:3.5.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M3'
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.1'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.9.1'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.0'
    implementation 'me.dm7.barcodescanner:zxing:1.9.7'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.9'
    implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0'
    implementation 'com.nimbusds:nimbus-jose-jwt:5.1'
    implementation 'io.card:android-sdk:5.5.1'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.brandongogetap:stickyheaders:0.5.1'
    implementation 'io.fotoapparat.fotoapparat:library:2.2.0'
    implementation 'com.sunmi:DS_Lib:1.0.11'
    implementation 'com.alibaba:fastjson:1.1.67.android'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    testCompile 'com.warrenstrange:googleauth:1.1.1'
    testCompile 'junit:junit:4.12'
    testCompile 'com.googlecode.json-simple:json-simple:1.1.1'
    androidTestCompile 'commons-io:commons-io:2.4'
    androidTestCompile 'org.apache.commons:commons-lang3:3.6'
    androidTestCompile 'ru.appex:mcash-sdk:6.0'
    androidTestCompile 'commons-codec:commons-codec:1.10'
//    androidTestCompile 'com.google.guava:guava:24.1-jre'

    implementation 'com.jakewharton:butterknife:9.0.0-rc1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'

    // For paymob
    implementation deps.support.multidex
    implementation deps.okhttp.core
    implementation deps.okhttp.logger
    implementation deps.guavaAndroid
    implementation deps.retrofit.core
    implementation deps.retrofit.converterGson
    implementation deps.retrofit.rxjava2Adapter
    implementation deps.rx.core
    implementation deps.rx.android
    implementation deps.logback.core
    implementation deps.retro_stream
    implementation(deps.logback.classic) {
        exclude group: 'com.google.android',module: 'android'
    }
    implementation deps.greendao
    implementation deps.timber
    implementation deps.paperdb
    implementation deps.slf4jApi

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

    implementation(group: 'roamlib',name: 'roamlib2',version: '196')

    implementation(group: 'm4bank',name: 'zlibrary',version: '2159',ext: 'aar')
    implementation(group: 'm4bank',name: 'cardreaderlib',version: '759')
    implementation(group: 'm4bank',name: 'connectionreaders',version: '759')
    implementation(group: 'external',name: 'emv-taglib',version: '2.5')

    // ================= Aisino ===============
    implementation(group: 'm4bank',name: 'aisino_common',version: '140')
    implementation(group: 'm4bank',name: 'aisinoprinterlib',version: '153')
    implementation(group: 'm4bank',name: 'aisino_a90lib',version: '438')
    implementation(group: 'm4bank',name: 'aisino_a90deps',version: 'master-1.1.43',name: 'asinalib',version: '75')
    implementation(group: 'm4bank',name: 'spirelib',version: '79')
    implementation(group: 'm4bank',name: 'fiscalprinterlibrary',version: '62')

    // =============== Wangpos ===============
    implementation(group: 'm4bank',name: 'wangposlib',version: '53')
    implementation(group: 'm4bank',name: 'wangposprinterlibrary',version: '35',ext: 'aar')
    implementation(group: 'external',name: 'SDK4BaseBinder',version: '2.1.5')
    implementation(group: 'external',name: 'SDK4EmvBinder',name: 'SDK4KeyManagerBinder',version: '2.1.5')


    implementation(group: 'm4bank',name: 'd200lib',version: '4')
    implementation(group: 'm4bank',name: 'icmplibrary',version: '16')
    implementation(group: 'm4bank',name: 'FptrServiceAndroid',version: '3')

    // Use response
    implementation 'com.getbase:floatingactionbutton:1.10.1'
//    implementation project(path:':useresponse',configuration: 'default')
    androidTestImplementation 'com.android.support.test:rules:1.0.2'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'

    // File downloading
    implementation "com.tonyodev.fetch2:fetch2:3.0.11"

    // Glide
    implementation 'com.github.bumptech.glide:annotations:4.11.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    implementation('com.github.bumptech.glide:okhttp3-integration:4.4.0') {
        exclude group: 'glide-parent'
    }

    // =============== NPAS ===================
    def openSdkProject = findProject(':Android_Opensdk')
    if (openSdkProject != null)
        implementation openSdkProject
    else
        implementation fileTree(dir: 'libs',include: ['*.jar'])

    def payLibProject = findProject(':Android_PayLib')
    if (payLibProject != null)
        implementation payLibProject
    else
        implementation files('libs/Android_SecPayLib-pax-compass-release.aar')

    def halApiProject = findProject(':Android_Hal_Api')
    if (halApiProject != null)
        implementation halApiProject

    implementation "android.arch.persistence.room:runtime:1.1.1"
    implementation "org.bouncycastle:bcprov-jdk15on:1.56"
    implementation "org.bouncycastle:bcpkix-jdk15on:1.56"
    implementation 'org.greenrobot:eventbus:3.2.0'
    compile files('libs/GLPage_V1.01.00_20171222.jar')
}

P.S.- 该项目在另一台 PC 上运行良好。

那么有没有办法解决这个问题?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-