请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/上提供有关最新版本的信息)或将com.google.android.gms的版本更新为15.0.2来修复版本冲突。
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 26
// buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 16
targetSdkVersion 22
signingConfig signingConfigs.config
versionCode 9
versionName '3.6'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
// signingConfig signingConfigs.config
}
}
packagingOptions {
// exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':slidingmenu_libs')
implementation project(':sqlite_helper')
implementation files('libs/httpclient-4.2.5.jar')
implementation files('libs/httpcore-4.2.4.jar')
implementation files('libs/httpmime-4.2.1.jar')
implementation files('libs/lib-autonotifyviewpager.jar')
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation('com.twitter.sdk.android:tweet-composer:1.0.3@aar') {
transitive = true;
}
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.eftimoff:android-viewpager-transformers:1.0.1@aar'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:customtabs:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-plus:15.0.1'
implementation 'com.facebook.android:facebook-android-sdk:4.24.0'
implementation 'jp.wasabeef:recyclerview-animators:2.2.1'
implementation 'com.github.ksoichiro:android-observablescrollview:1.6.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'
testImplementation 'junit:junit:4.12'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
将google-service插件更新为'com.google.gms:google-services:3.3.0'
但是,最好在同一个库文件中使用相同的版本,以防止任何项目同步崩溃。
例,
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.google.firebase:firebase-ads:15.0.2'
implementation 'com.google.android.gms:play-services-auth:15.0.2'
implementation 'com.google.android.gms:play-services-plus:15.0.2'
有时它会在您更新Google Play服务或firebase依赖项时发生,您可以通过更新build.gradle
(项目)文件中的play服务插件来解决此问题:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}