首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >尝试将google places库添加到我的项目时出现问题

尝试将google places库添加到我的项目时出现问题
EN

Stack Overflow用户
提问于 2019-07-25 05:33:12
回答 2查看 1.2K关注 0票数 2

对不起,我的英语...好了,当我添加google places库的依赖项并同步它的所有东西时,ok,但直到我构建,显示一个重复的类错误,我尝试添加一个注释处理器,但它不起作用…我希望能帮上忙谢谢。

库:实现'com.google.android.libraries.places:places:1.1.0‘

尝试解决实现此依赖关系

代码语言:javascript
复制
    annotationProcessor 'com.google.auto.value:auto-value:1.6.2'
    implementation 'com.google.auto.value:auto-value-annotations:1.6.2'

和升级依赖项,但不幸的是

代码语言:javascript
复制
    implementation 'com.google.auto.value:auto-value:1.6.5'
    implementation 'com.google.auto.value:auto-value-annotations:1.6.5'

我的依赖项

代码语言:javascript
复制
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'

错误

代码语言:javascript
复制
Duplicate class com.google.auto.value.AutoAnnotation found in modules auto-value-1.2.jar (com.google.auto.value:auto-value:1.2) and auto-value-annotations-1.6.2.jar (com.google.auto.value:auto-value-annotations:1.6.2)
Duplicate class com.google.auto.value.AutoValue found in modules auto-value-1.2.jar (com.google.auto.value:auto-value:1.2) and auto-value-annotations-1.6.2.jar (com.google.auto.value:auto-value-annotations:1.6.2)
Duplicate class com.google.auto.value.AutoValue$Builder found in modules auto-value-1.2.jar (com.google.auto.value:auto-value:1.2) and auto-value-annotations-1.6.2.jar (com.google.auto.value:auto-value-annotations:1.6.2)

Go to the documentation to learn how to Fix dependency resolution errors.
EN

回答 2

Stack Overflow用户

发布于 2019-07-26 04:02:42

我解决了这个错误,通过gradle执行依赖任务来查看所有依赖树。它显示的所有依赖项和子依赖项帮助我找到了正在使用的其他依赖项(com.google.auto.value:auto-value:1.2),并且我在google tannslate依赖项中发现了这个问题,所以只从('com.google.cloud:google-cloud-translate:1.12.0')中排除了重复的依赖项。

google translate依赖关系就是这样的:

代码语言:javascript
复制
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'
}

希望可以帮助任何其他人解决相同或相似的问题

票数 2
EN

Stack Overflow用户

发布于 2020-06-30 03:29:40

将此添加到您的gradle(应用程序)中

代码语言:javascript
复制
configurations.all {
    resolutionStrategy {
        force("com.google.auto.value:auto-value:1.6.3")
    }
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57191551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档