错误:任务':app:processDebugGoogleServices'执行失败。 请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/提供有关最新版本的信息)或将com.google.android.gms的版本更新为9.2.0来修复版本冲突。
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.nadav.firebasedemo"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-auth:11.4.2'
implementation 'com.google.firebase:firebase-messaging:11.4.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.1'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-crash:9.2.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
答案 0 :(得分:0)
尝试更新 firebase
dependencies
,因为您需要在 {中使用相同版本的dependencies
{1}} 强>
build.Gradle
答案 1 :(得分:0)
您使用3个不同版本的firebase库。
override func layoutSubviews() {
super.layoutSubviews()
label.layer.cornerRadius = label.frame.size.width/2
}
您必须使用相同的版本。
使用最新版本:
implementation 'com.google.firebase:firebase-messaging:11.4.2'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-crash:9.2.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'