【发布时间】:2018-02-07 07:57:17
【问题描述】:
问题更新:在与教程的创建者交谈后,我尝试使用 Firebase 创建实时聊天。他告诉我改变你的 Gradle compile 'com.google.firebase:firebase-core:9.4.0' 编译'com.google.firebase:firebase-database:9.4.0'
如果是这种情况,我需要更改我的依赖项以使用此 9.4.0 版本吗?
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
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 {
jcenter()
maven { url 'https://maven.fabric.io/public' } // <= ADD THIS
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Below is the Module:app Gradle
Here is where I am trying to compile the Firebase UI in order to make a chat application within my app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.aids.a09application"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android {
useLibrary 'org.apache.http.legacy'
}
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:11.2.0'
compile 'com.google.firebase:firebase-messaging:11.2.0'
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.google.android.gms:play-services-maps:11.2.0'
compile 'com.google.firebase:firebase-auth:11.2.0' // ADDED
compile 'com.google.android.gms:play-services-auth:11.2.0' // ADDED
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
这是我现在遇到的错误:
Error:Execution failed for task ':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 11.2.0.
【问题讨论】:
-
为什么不添加最新的 Firebase 依赖项?例如。 'com.google.firebase:firebase-core:11.2.0'
-
错误 - 无法解决 com.google.firebase:firebase-core:11.2.0 等
-
如果您不想从 10.2.4 和 25.3.1 升级,请将
firebase-ui-auth:2.3.0降级为firebase-ui-auth:1.2.0 -
更新了我的 Gradles,现在有一个新的错误。上面的问题更新了新的错误
标签: java android maven firebase gradle