在 android studio 中更新依赖项出现以下错误。
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.0.0.
以前我的依赖项如下。
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
abuildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.android.myapp"
minSdkVersion 15
targetSdkVersion 24
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:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:palette-v7:24.0.0'
compile 'com.android.support:mediarouter-v7:24.0.0'
compile 'com.google.firebase:firebase-ads:9.0.0'
compile 'com.google.firebase:firebase-crash:9.0.0'
compile 'com.google.firebase:firebase-analytics:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
换行时出现错误
compile 'com.google.android.gms:play-services-ads:9.0.0'
一个
compile 'com.google.android.gms:play-services-ads:9.2.0'
检查您是否没有激活 Gradle 的“离线工作”选项,这可能是它没有下载依赖项的原因,我看到该版本确实存在。这是从菜单访问的顺序:
File
>Settings
>Build, Execution, Deployment
> 构建工具 >Gradle
将您的项目与 Gradle 文件同步!
确保更新最新版本的Google Play Services和Google Repository,以便您可以支持最新版本的
play-services-ads:9.2.0
在项目的 Gradle 文件中,您有
这是迄今为止该插件的最新版本。在他们更新插件以支持 9.2.0 版之前,您必须返回到 9.0.2 版
已修复,firebase 插件也必须更新到 9.2.0 版