首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >添加Google依赖项时找到重复类

添加Google依赖项时找到重复类
EN

Stack Overflow用户
提问于 2020-06-29 14:06:30
回答 1查看 712关注 0票数 2

添加google照片库api依赖项后引发重复类查找错误

'com.google.photos.library:google-photos-library-client:1.5.0‘

。几乎所有的解决方案都试过了,但都没有用。

我的等级(模块)文件(依赖项)

代码语言:javascript
复制
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
//    implementation project(':gcm')


    //design
    implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
    implementation "com.google.android.material:material:${design_version.design}"
    implementation "androidx.cardview:cardview:${design_version.card_view}"
    implementation "androidx.recyclerview:recyclerview:${design_version.recycler_view}"
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation "androidx.constraintlayout:constraintlayout:${design_version.constant_layout}"
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'

    implementation 'se.emilsjolander:StickyScrollViewItems:1.1.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    //image view
    implementation 'com.squareup.picasso:picasso:2.71828'

    //facebook integration
    implementation 'com.facebook.android:account-kit-sdk:4.37.0'

    //image cropper
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.+'

    //chart
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
    //glide
    implementation 'com.github.bumptech.glide:glide:4.9.0'

    //retrofit & square ok http & gson
    implementation 'com.squareup.retrofit2:retrofit:2.5.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
    implementation "com.squareup.okhttp3:okhttp-urlconnection:3.0.1"
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation 'com.squareup.okhttp3:okhttp:3.12.0'
    implementation 'com.google.code.gson:gson:2.8.6'

    //firebase
    implementation 'com.google.firebase:firebase-core:17.4.3'
    implementation 'com.google.firebase:firebase-messaging:20.2.1'
    implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.7'
    implementation 'com.google.firebase:firebase-analytics:17.4.3'
    implementation 'com.google.firebase:firebase-config-ktx:19.1.4'
    implementation 'com.google.firebase:firebase-database-ktx:19.3.1'

    //validator
    implementation 'com.github.SoumikBhatt.toaster:validator:1.2.6'
    //popup
    implementation 'com.github.SoumikBhatt.toaster:custompopup:1.2.6'
    //proToast
    implementation 'com.github.SoumikBhatt:ToastLikeAPro:1.0.1'
    //Utils
    implementation 'com.github.SoumikBhatt:Utills:1.0.1'
    //force update
    implementation 'com.github.SoumikBhatt:PushNotification:1.1.5'

    //lottie
    implementation 'com.airbnb.android:lottie:3.4.0'

    //spotlight
    implementation 'com.github.takusemba:spotlight:2.0.1'

    //google photos
    implementation 'com.google.photos.library:google-photos-library-client:1.5.0'

    //flurry
//    api 'com.flurry.android:analytics:12.0.3@aar'
    implementation 'com.flurry.android:analytics:12.2.0'

    implementation 'com.google.android.gms:play-services-base:17.3.0'
    implementation 'com.google.android.gms:play-services-auth:18.0.0'
    implementation 'com.baoyz.swipemenulistview:library:1.3.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    testImplementation 'junit:junit:4.12'

    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation "androidx.core:core-ktx:1.1.0"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

完全错误:

代码语言:javascript
复制
Duplicate class com.google.api.Advice found in modules jetified-proto-google-common-protos-1.17.0.jar (com.google.api.grpc:proto-google-common-protos:1.17.0) and jetified-protolite-well-known-types-17.0.0-runtime.jar (com.google.firebase:protolite-well-known-types:17.0.0)
Duplicate class com.google.api.Advice$1 found in modules jetified-proto-google-common-protos-1.17.0.jar (com.google.api.grpc:proto-google-common-protos:1.17.0) and jetified-protolite-well-known-types-17.0.0-runtime.jar (com.google.firebase:protolite-well-known-types:17.0.0)
.
.
.

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

任何形式的帮助都会受到高度赞赏。提亚

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-06-29 14:33:03

看起来Firebase也有类似的依赖性。尝试在gradle中的一个依赖项中进行抑制

就像下面的依赖:

代码语言:javascript
复制
configurations.implementation.exclude(group: 'com.google.firebase', module: 'protolite-well-known-types') 

应该是类似的东西。

参考here

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62639939

复制
相关文章

相似问题

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