所以我使用firebase助手将“实时数据库”集成到我的应用程序中,但是我对gradle文件有些麻烦 这是我的项目gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
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
}
这是我的模块gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.matei.gotcha20"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible,GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-database:11.0.4'
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.android.gms:play-services:11.6.2'
annotationProcessor 'com.jakewharton:butterknife:6.1.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.android.support:support-annotations:27.0.2'
compile "com.google.firebase:firebase-auth:11.6.2"
compile 'com.github.clans:fab:1.6.4'
}
apply plugin: 'com.google.gms.google-services'
我得到的错误如下:错误:任务':app:processDebugGoogleServices'的执行失败。
请通过更新google-services插件的版本(https://bintray.com/android/android-tools/com.google.gms.google-services/提供有关最新版本的信息)或将com.google.android.gms的版本更新为11.6.2来修复版本冲突。 如果我删除这一行
apply plugin: 'com.google.gms.google-services'
它可以工作,但当我点击“集成实时数据库”时,firebase助手会自动添加该行
答案 0 :(得分:0)
您的Firebase数据库相关性为11.0.4,auth为11.6.2
同时制作11.6.2
还在根级别gradle文件中使用google服务版本3.1.1