java - 在模块 auto-value-1.2.jar 中发现重复的类 com.google.auto.value.AutoAnnotation
问题描述
我正在尝试运行我 1.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.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 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) 在模块 commons-codec-1.3.jar (commons-codec:commons-codec:1.3) 和 org-apache-commons-codec.jar (org-apache-公共编解码器。jar) 重复类 org.apache.commons.codec.BinaryEncoder 在模块 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.Decoder 在模块 commons-codec-1.3.jar (commons-codec:commons-codec:1.3) 和
有这么多相同类型的错误,如果我不使用“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'
解决方案
尝试更换
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'
推荐阅读
- mongodb - 连接mongodb失败
- reactjs - 可以使用 react-testing-library 在测试中调用作为组件属性传递的函数吗
- php - 将课程添加到列表中的当前帖子标题
- javascript - 无法安装 jspdf 1.5.3
- python-3.x - 使用 python 将值存储到 cassandra
- android - 如何修复“无法确定应用程序 ID:com.android.tools.idea.run.ApkProvisionException:变体的主要工件没有输出:”
- objective-c - FMDB MODIFY 查询无法在现有 SQLite 数据库中设置约束
- html - 选择标签占位符
- linux - 我可以(IGMP)加入两个 NIC 上的流并在 Linux 中回答(IGMP)两个 NIC 上的查询吗?
- sorting - Elasticsearch 5:按最近批发商的价格排序