[英]fix the version conflict either by updating the version of the google-services plugin
I am using Google's Firebase (For notification) and Places (For address and location) API in my project. 我在项目中使用Google的Firebase(用于通知)和Places(用于地址和位置)API。 Latest version of both are 16.0.6 and 16.0.0 respectively that I am using in app.
我在应用程序中使用的最新版本均为16.0.6和16.0.0。
When integrating either api, app is working fine. 集成任何一个api时,app都可以正常工作。 But on integrating together it gives below error:
但是在集成在一起时会出现以下错误:
Execution failed for task ':app:processDebugGoogleServices'.
任务':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.6.
请通过更新google-services插件的版本来解决版本冲突(有关最新版本的信息, 请访问https://bintray.com/android/android-tools/com.google.gms.google-services/ )或将com.google.android.gms的版本更新为16.0.6。
I checked other posts too, but they are old now and not helping me. 我也检查了其他帖子,但是它们现在已经很旧了,无法帮助我。
Below is my app module's build.gradle
下面是我的应用程序模块的
build.gradle
apply plugin: 'com.android.application'
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://maven.google.com"
}
}
dependencies {
// replace with the current version of the Android plugin
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.1.1'
}
}
android {
compileSdkVersion 26
defaultConfig {
applicationId "abc.xyz"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
// add below section
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath true
}
}
}
buildTypes {
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
signingConfig signingConfigs.Release
zipAlignEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
signingConfig signingConfigs.Release
zipAlignEnabled true
}
}
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}
configurations {
all*.exclude group: 'com.android.support', module: 'support-v13'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
//LinkedIn SDK
implementation project(':linkedin-sdk')
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.ethanhua:skeleton:1.1.2'
implementation 'io.supercharge:shimmerlayout:2.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.facebook.android:facebook-android-sdk:4.34.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'org.androidannotations:androidannotations-api:4.3.1'
<!-- Google apis -->
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.android.gms:play-services:12.0.1'
implementation 'com.google.android.gms:play-services-places:16.0.0'
annotationProcessor 'org.androidannotations:androidannotations:4.3.1'
}
apply plugin: 'com.google.gms.google-services'
Is there any otherway I can work with both? 我还有其他办法可以同时使用吗?
I could not figure out what is wrong here. 我不知道这里出了什么问题。 But i tried downgrading version number to 12.0.1 of both libraries and it worked fine.
但是我尝试将两个库的版本号降级到12.0.1,并且运行良好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.