com.google.android.gms:play-services-maps:9.4.0的build.gradle错误 [英] Error build.gradle with com.google.android.gms:play-services-maps:9.4.0
问题描述
在我的应用中,我具有以下依赖性:
In my app I have these dependencies:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.package_app.name"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-messaging:9.2.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:design:23.2.1'
compile "com.android.support:recyclerview-v7:23.2.1"
compile 'com.android.support:cardview-v7:23.2.1'
compile 'com.google.android.gms:play-services-maps:9.4.0'
}
在我说的这些依赖之下
apply plugin: 'com.google.gms.google-services'
但是我无法构建应用,因为返回此错误.
But I can't build app because return this error.
Error: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 9.2.0.
所以我尝试放
compile 'com.google.android.gms:play-services-maps:9.2.0'
然后构建应用,所以我的问题是: 为什么我不能使用服务地图的最新版本?
And the app build, so my question is: Why I can't use the last versione of services-map?
推荐答案
昨天我遇到了相同的问题,并通过以下操作解决了该问题:
I faced the same issue yesterday and solved it by doing the follows :
首先,请确保您的项目/顶级gradle文件在依赖项内具有适用于Google服务的最新版本
Firstly, make sure that you project/top level gradle file has the latest version for google services inside dependencies
classpath 'com.google.gms:google-services:3.0.0'
第二,确保将插件放在gradle应用文件的底部
Secondly, make sure to put the plugin at the bottom of the gradle app file
apply plugin: 'com.google.gms.google-services'
并确保所有Google服务依赖项(包括firebase)具有相同的版本,即9.4.0
And make sure all google services dependencies including firebase are of the same version i.e. 9.4.0
compile 'com.google.android.gms:play-services:9.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-auth:9.4.0'
这是我目前在app.gradle依赖项中的内容.
This is what i currently have in my app.gradle dependencies.
这篇关于com.google.android.gms:play-services-maps:9.4.0的build.gradle错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!