冲突在哪里,如何解决,以及日后寻找冲突的根源?
block 引用>
- What went wrong: Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 16.0.0.
compileSdkVersion 27 buildToolsVersion '27.0.3' defaultConfig { minSdkVersion 17 targetSdkVersion 27 } implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-layout:1.1.0' implementation 'com.android.support:design:27.1.1' implementation 'com.android.support:cardview-v7:27.1.1' implementation 'com.google.android.gms:play-services-analytics:16.0.0' implementation 'com.google.android.gms:play-services-location:15.0.1' implementation 'com.google.android.gms:play-services-maps:15.0.1' implementation 'com.google.android.gms:play-services-places:15.0.1' implementation 'com.google.maps.android:android-maps-utils:0.4.3' implementation 'com.google.firebase:firebase-messaging:17.0.0' implementation 'com.google.firebase:firebase-crash:16.0.0' apply plugin: 'com.google.gms.google-services'
最佳答案
您的依赖项之一是拥有不同版本的 com.google.android.gms
。
我检查了 github page 中的 com.google.maps.android:android-maps-utils:0.4.3
。我发现它使用的是非常旧版本的 map ,请参见上面的页面。
dependencies {
compile 'com.google.android.gms:play-services-maps:11.0.4'
}
作为解决方案,您可以
- 按照与 maps-utils 相同的方式降级您的播放服务依赖项版本
- 或者您可以通过从 github 页面下载来升级此依赖项 gms 版本,并将其作为模块添加到您的项目中。
请记住,如果您在应用中使用最新版本的 gms 依赖项,请在项目级别 build.gradle
中使用最新的 google-services。喜欢
classpath 'com.google.gms:google-services:3.3.0'
编辑 使用此配置降级您的 gms 和 firebase 版本。
def GMS_VERSION = "11.0.4"
def FCM_VERSION = "11.0.4"
dependencies {
// ...
implementation "com.google.android.gms:play-services-analytics:$GMS_VERSION"
implementation "com.google.android.gms:play-services-location:$GMS_VERSION"
implementation "com.google.android.gms:play-services-maps:$GMS_VERSION"
implementation "com.google.android.gms:play-services-places:$GMS_VERSION"
implementation 'com.google.maps.android:android-maps-utils:0.4.3'
implementation "com.google.firebase:firebase-messaging:$FCM_VERSION"
implementation "com.google.firebase:firebase-crash:$FCM_VERSION"
}
关于android - 如何解决依赖冲突?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50668581/