Android 如何解决错误:在项目中';app&x27;已解决的Google Play服务库依赖关系

Android 如何解决错误:在项目中';app&x27;已解决的Google Play服务库依赖关系,android,android-gradle-plugin,build.gradle,Android,Android Gradle Plugin,Build.gradle,在我将com.google.android.gms:play services ads依赖项从17.2.0更新为18.0.0后,我得到以下错误: ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.5. 0]", but isn't being resolved to that version. Be

在我将
com.google.android.gms:play services ads
依赖项从17.2.0更新为18.0.0后,我得到以下错误:

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[16.5.
0]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.google.android.gms:play-services-measurement-api:16.5.0 -> com.google.android.gms:play-services-
measurement-sdk-api@[16.5.0], but play-services-measurement-sdk-api version was 17.0.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.android.gms:play-services-ads@18.0.0
-- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 16.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-ads@{strictly 18.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 16.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk@{strictly 16.5.0}
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-sdk-api@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-core@16.0.9
-- Project 'app' depends onto com.google.android.gms:play-services-ads-lite@{strictly 18.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-core@{strictly 16.0.9}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.
Gradle

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.github.dimitrisCBR:GradientTextView:1.2'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.mediarouter:mediarouter:1.0.0'
    implementation 'androidx.exifinterface:exifinterface:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.browser:browser:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'dev.dworks.libs:volleyplus:0.1.4'
    implementation 'com.github.clans:fab:1.6.4'
    implementation 'com.github.pedromassango:doubleClick:3.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.github.bumptech.glide:okhttp3-integration:4.9.0'
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.google.firebase:firebase-core:16.0.9'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
    implementation project(':library')
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    implementation 'com.yarolegovich:discrete-scrollview:1.4.9'
    implementation 'com.github.esafirm.android-image-picker:imagepicker:1.12.0'
    implementation 'jp.wasabeef:glide-transformations:4.0.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.vodyasov:amr:0.5'
    implementation 'org.apache.commons:commons-lang3:3.9'
    implementation 'com.google.guava:guava:26.0-android'
    testImplementation 'junit:junit:4.12'
    implementation 'de.hdodenhof:circleimageview:3.0.0'
    implementation 'androidx.palette:palette:1.0.0'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
    implementation 'com.google.android.exoplayer:exoplayer:2.10.1'
    implementation 'com.squareup:otto:1.3.8'
    implementation 'org.apache.commons:commons-collections4:4.3'
    implementation 'org.greenrobot:eventbus:3.1.1'
    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.0.2'
    implementation 'com.google.android.gms:play-services-ads:18.0.0'
}
apply plugin: 'com.google.gms.google-services'

Gradle文件中的依赖项似乎存在版本冲突

请查查看

maven.google.com上发布的工件
com.google.android.gms:播放服务广告:18.0.0
com.google.firebase:firebase核心:17.0.0
com.google.firebase:firebase消息:19.0.0

等等

在您的代码中,与firebase相关的代码似乎基于版本

非常感谢,我用CTRL+F搜索com.google.*依赖项,我更新了它们,问题解决了
implementation 'com.google.android.gms:play-services-ads:18.0.0'
implementation 'com.google.firebase:firebase-core:16.0.9' // old
implementation 'com.google.firebase:firebase-messaging:18.0.0' // old