在模块 auto-value-1.2.jar 中发现重复的类 com.google.auto.value.AutoAnnotation。

5

我正在尝试运行我一年半前的项目,但遇到了很多错误。我已经更新了所有依赖项。

我遇到了一些我不理解的错误。

在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.3.jar(com.google.auto.value:auto-value-annotations:1.6.3)中找到重复类com.google.auto.value.AutoAnnotation 在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.3.jar(com.google.auto.value:auto-value-annotations:1.6.3)中找到重复类com.google.auto.value.AutoValue 在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.3.jar(com.google.auto.value:auto-value-annotations:1.6.3)中找到重复类com.google.auto.value.AutoValue$Builder 在模块commons-codec-1.3.jar(commons-codec:commons-codec:1.3)和org-apache-commons-codec.jar(org-apache-commons-codec.jar)中找到重复类org.apache.commons.codec.BinaryDecoder 在模块commons-codec-1.3.jar(commons-codec:commons-codec:1.3)和org-apache-commons-codec.jar(org-apache-commons-codec.jar)中找到重复类org.apache.commons.codec.BinaryEncoder 在模块commons-codec-1.3.jar(commons-codec:commons-codec:1.3)中发现重复类org.apache.commons.codec.Decoder

如果我不使用"auto-value-annotations-1.6.3.jar",会遇到同类型的许多错误。

以下是我的gradle文件:

apply plugin: 'com.android.application'

android {

compileSdkVersion 28
defaultConfig {
    applicationId "***"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode 107
    versionName "1.0"
    multiDexEnabled true
    javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }

}

buildTypes {
    debug {
        minifyEnabled false
        buildConfigField "int", "FOO", "42"
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

sourceSets {
    main {
        assets.srcDirs = ['src/main/assets', 'src/main/assets/font']
        res.srcDirs = ['src/main/res', 'src/main/res/values-de', 'src/main/res/values-sw720dp  ']
    }
}

dexOptions {
    preDexLibraries = false
    javaMaxHeapSize "8g"
}

useLibrary 'org.apache.http.legacy'

lintOptions {
    disable 'MissingTranslation'
    abortOnError false
}

dataBinding {
    enabled = true
}

packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'

    exclude 'project.properties'
    pickFirst 'META-INF/*'
    exclude 'org/apache/http/version.properties'
    exclude 'org/apache/http/client/version.properties'
}

}

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute module('org.apache.commons:commons-io:1.3.2') with module('commons-io:commons-io:1.3.2')
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    implementation project(':ucrop')
    implementation project(':library')
    implementation project(':datePicker')
    implementation project(':cropImage')
    implementation project(':simplecropview')
    implementation files('libs/aspectjrt-1.7.3 (1).jar')
    implementation files('libs/isoparser-1.0.6.jar')
//support library
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation "com.android.support:design:27.1.0"
implementation "com.android.support:cardview-v7:27.1.0"
implementation "com.android.support:recyclerview-v7:27.1.0"

//for load HTML file
implementation project(':HtmlTextView')

//for web socket connection
implementation 'org.java-websocket:Java-WebSocket:1.3.0'

//for crashlytics
implementation 'net.hockeyapp.android:HockeySDK:4.0.2'

implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'org.solovyev.android.views:linear-layout-manager:0.5@aar'

implementation 'com.daimajia.swipelayout:library:1.2.0@aar'

//for gallery
implementation 'com.octo.android.robospice:robospice:1.4.14'

//for audio recorder
implementation 'com.github.republicofgavin:pauseresumeaudiorecorder:1.0'

//for get api response
implementation 'com.loopj.android:android-async-http:1.4.9'

//for image load
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'

//for pdf viewer
implementation 'com.github.barteksc:android-pdf-viewer:2.7.0-beta.1'

//for push notification
implementation "com.google.firebase:firebase-messaging:18.0.0"
implementation "com.google.android.gms:play-services-gcm:16.1.0"

//for speech memo
implementation 'com.google.cloud:google-cloud-speech:0.24.0-alpha'
testImplementation group: 'org.mortbay.jetty.alpn', name: 'alpn-boot', version: '8.1.0.v20141016'

implementation 'com.android.support:multidex:1.0.3'

annotationProcessor 'com.google.auto.value:auto-value:1.1'
}
apply plugin: 'com.google.gms.google-services'

可能与此问题相关:https://github.com/google/data-transfer-project/issues/173 - Léa Gris
1个回答

0
尝试替换

annotationProcessor 'com.google.auto.value:auto-value:1.1'

annotationProcessor 'com.google.auto.value:auto-value:1.6.3'
implementation 'com.google.auto.value:auto-value-annotations:1.6.3'

抱歉,但问题仍然存在。 - Umesh AHIR

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接