iLy*_*yas 8 android gradle firebase google-play-services
我知道存在版本冲突,但在Google发布新版本后问题仍然存在.
错误:任务':app:processCurrentDebugGoogleServices'的执行失败.请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问 https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为11.4.0.
我的build.gradle(模块:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.x.x"
minSdkVersion 9
targetSdkVersion 26
versionCode 10
versionName "1.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
legacy {
minSdkVersion 9
}
current {
minSdkVersion 14
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
legacyCompile 'com.google.firebase:firebase-ads:10.0.1'
legacyCompile 'com.google.firebase:firebase-core:10.0.1'
currentCompile 'com.google.firebase:firebase-ads:11.4.0'
currentCompile 'com.google.firebase:firebase-core:11.4.0'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
我的Build.gradle :(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.1'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)
现在需要做哪些改变?
谢谢,
小智 11
在真正的解决方案只是移动
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
在(app)build.gradle脚本的底部并重建项目.100%工作
冲突是在较新版本的插件和Play服务/ Firebase依赖项之间.
您不能为不同的产品风格应用同一插件的不同版本,因此在尝试使用不同风格的不同Play服务依赖项时,您将遇到此冲突.
您可以:
| 归档时间: |
|
| 查看次数: |
4377 次 |
| 最近记录: |