更新#2 2018/05/29
这个问题看起来现在已经解决了,我仍然在使用相同的gradle配置。但是我前一段时间做了这些步骤,我不确定这些步骤是否起作用,或者这是否是服务器端问题,并且最近已修复/更新。我只是注意到在执行以下步骤后问题不再存在:
在项目级别的gradle.build buildscript > repositories
和中添加以下内容allprojects > repositories
。
google()
maven { url 'http://jcenter.bintray.com' }
将google-services类路径更改为
classpath com.google.gms:google-services:4.0.1'
与Gradle文件同步项目
更新#1 2018/05/29
我通过在应用程序级 gradle中将Firebase 依赖项降级为〜12.0.0来解决该错误。但这将严重影响应用程序,仍在寻找更可行的解决方法。
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
...
compile 'com.google.firebase:firebase-core:12.0.0'
compile 'com.google.firebase:firebase-database:12.0.0'
compile 'com.google.firebase:firebase-storage:12.0.0'
compile 'com.google.firebase:firebase-auth:12.0.0'
compile 'com.google.firebase:firebase-crash:12.0.0'
...
同样在这里,我遇到了@SimbaClaws描述的相同问题。一切进展顺利,直到昨天我遇到同样的问题。
我在项目级别的 build.gradle中有以下代码,
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
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.0.0'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.1'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
以及以下用于应用程序级 build.gradle的代码
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "my.secret.application"
minSdkVersion 16 // 19
targetSdkVersion 26
versionCode 1
versionName "5.0.204"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
})
compile 'com.google.firebase:firebase-core:15.0.2'
compile 'com.google.firebase:firebase-database:15.0.0'
compile 'com.google.firebase:firebase-storage:15.0.2'
compile 'com.google.firebase:firebase-auth:15.1.0'
compile 'com.google.firebase:firebase-crash:15.0.2'
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.android.support:palette-v7:26.+'
compile 'com.android.support:support-v4:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'org.greenrobot:eventbus:3.1.1'
testCompile 'junit:junit:4.12'
compile 'com.crashlytics.sdk.android:crashlytics:2.9.1'
}
apply plugin: 'com.google.gms.google-services'
谁能告诉我我错过了什么吗?我还在寻找可能的解决方法和答案。TIA!