Java 尝试将google places库添加到项目时出现的问题
对不起,我的英语。。。好了,让我们走吧,当我添加GooglePlaces库的dependencie并同步它的所有东西时,好了,但在我构建之前,显示了一个重复的类错误。我尝试添加注释处理器,但它不起作用。。。我希望能得到一些帮助,谢谢 图书馆:实现'com.google.android.libraries.places:places:1.1.0' 试图解决此依赖关系Java 尝试将google places库添加到项目时出现的问题,java,android,android-studio,build.gradle,google-places,Java,Android,Android Studio,Build.gradle,Google Places,对不起,我的英语。。。好了,让我们走吧,当我添加GooglePlaces库的dependencie并同步它的所有东西时,好了,但在我构建之前,显示了一个重复的类错误。我尝试添加注释处理器,但它不起作用。。。我希望能得到一些帮助,谢谢 图书馆:实现'com.google.android.libraries.places:places:1.1.0' 试图解决此依赖关系 annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
implementation 'com.google.auto.value:auto-value-annotations:1.6.2'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:palette-v7:$supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
//implementation 'com.google.auto.value:auto-value-annotations:1.6.2'
//implementation 'com.google.auto.value:auto-value:1.6.5'
//implementation 'com.google.auto.value:auto-value-annotations:1.6.5'
//annotationProcessor 'com.google.auto.value:auto-value-compiler:1.6.5'
implementation 'com.google.android.libraries.places:places:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.zhihu.android:matisse:0.5.2-beta3'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
implementation 'com.github.hani-momanii:SuperNova-Emoji:1.1'
implementation 'com.kailashdabhi:om-recorder:1.1.5'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'com.github.codekidX:storage-chooser:2.0.4.2'
implementation 'com.fxn769:musicwave:1.0'
implementation 'ca.barrenechea.header-decor:header-decor:0.2.8'
implementation 'com.thoughtbot:expandablecheckrecyclerview:1.4'
implementation 'com.devlomi.record-view:record-view:2.0.1'
implementation 'io.realm:android-adapters:3.1.0'
implementation 'com.devlomi.hidely:hidely:1.0.0'
implementation 'com.github.broakenmedia:MultiContactPicker:1.8.5'
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.github.ozodrukh:CircularReveal:1.1.0'
implementation 'com.github.oxoooo:pull-back-layout:1.0.1'
implementation 'io.michaelrocks:libphonenumber-android:8.4.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'me.zhanghai.android.systemuihelper:library:1.0.0'
implementation 'com.evernote:android-job:1.2.6'
implementation 'com.devlomi:circularstatusview:1.0.1'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
implementation project(path: ':cameraView')
implementation project(path: ':stories-progress-view')
implementation(name: 'sinch-android-rtc-3.12.8', version: '3.12.8', ext: 'aar')
implementation 'com.txusballesteros:AutoscaleEditText:1.0'
implementation('com.google.cloud:google-cloud-translate:1.12.0') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json', module: 'json'
}
annotationProcessor 'com.google.cloud:google-cloud-translate:1.12.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
apply plugin: 'com.google.gms.google-services'
和升级的依赖,但不幸的是
implementation 'com.google.auto.value:auto-value:1.6.5'
implementation 'com.google.auto.value:auto-value-annotations:1.6.5'
我的依赖关系
annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
implementation 'com.google.auto.value:auto-value-annotations:1.6.2'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.android.support:design:$supportLibraryVersion"
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:palette-v7:$supportLibraryVersion"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
//annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
//implementation 'com.google.auto.value:auto-value-annotations:1.6.2'
//implementation 'com.google.auto.value:auto-value:1.6.5'
//implementation 'com.google.auto.value:auto-value-annotations:1.6.5'
//annotationProcessor 'com.google.auto.value:auto-value-compiler:1.6.5'
implementation 'com.google.android.libraries.places:places:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-storage:15.0.2'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-functions:16.1.1'
implementation 'com.firebaseui:firebase-ui-auth:4.3.2'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.zhihu.android:matisse:0.5.2-beta3'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
implementation 'com.github.hani-momanii:SuperNova-Emoji:1.1'
implementation 'com.kailashdabhi:om-recorder:1.1.5'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'com.github.codekidX:storage-chooser:2.0.4.2'
implementation 'com.fxn769:musicwave:1.0'
implementation 'ca.barrenechea.header-decor:header-decor:0.2.8'
implementation 'com.thoughtbot:expandablecheckrecyclerview:1.4'
implementation 'com.devlomi.record-view:record-view:2.0.1'
implementation 'io.realm:android-adapters:3.1.0'
implementation 'com.devlomi.hidely:hidely:1.0.0'
implementation 'com.github.broakenmedia:MultiContactPicker:1.8.5'
implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.github.ozodrukh:CircularReveal:1.1.0'
implementation 'com.github.oxoooo:pull-back-layout:1.0.1'
implementation 'io.michaelrocks:libphonenumber-android:8.4.1'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.10.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'me.zhanghai.android.systemuihelper:library:1.0.0'
implementation 'com.evernote:android-job:1.2.6'
implementation 'com.devlomi:circularstatusview:1.0.1'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
implementation project(path: ':cameraView')
implementation project(path: ':stories-progress-view')
implementation(name: 'sinch-android-rtc-3.12.8', version: '3.12.8', ext: 'aar')
implementation 'com.txusballesteros:AutoscaleEditText:1.0'
implementation('com.google.cloud:google-cloud-translate:1.12.0') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json', module: 'json'
}
annotationProcessor 'com.google.cloud:google-cloud-translate:1.12.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
apply plugin: 'com.google.gms.google-services'
错误
在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.2.jar(com.google.auto.value:auto-value-annotations:1.6.2)中找到重复类com.google.auto.value.AutoAnnotation
在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.2.jar(com.google.auto.value:auto-value-annotations:1.6.2)中找到重复的类com.google.auto.value.AutoValue
在模块auto-value-1.2.jar(com.google.auto.value:auto-value:1.2)和auto-value-annotations-1.6.2.jar(com.google.auto.value:auto-value-annotations:1.6.2)中找到重复的类com.google.auto.value.AutoValue$Builder
转到文档以了解如何修复依赖项解析错误。
我解决了这个错误,通过gradle执行dependencies任务以查看所有dependencies树。
它显示了所有依赖项和子依赖项,帮助我找到了其他依赖项使用的内容(com.google.auto.value:auto-value:1.2),我在google tannslate dependency中发现了问题,因此仅从('com.google.cloud:google cloud translate:1.12.0')重复依赖项中排除
谷歌翻译依赖性就是这样:
implementation('com.google.cloud:google-cloud-translate:1.12.0') {
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.json', module: 'json'
exclude group: 'com.google.auto.value', module: 'auto-value'
}
希望可以帮助其他有相同或类似问题的人将此添加到你的gradle(应用程序)中