gpt4 book ai didi

android - 添加 firebase 依赖项会导致 gradle 同步失败

转载 作者:行者123 更新时间:2023-12-03 04:58:19 26 4
gpt4 key购买 nike

我通过 Tools->Firebase->Add Real Time Database 添加了 firebase 数据库依赖项到您的应用程序方法,这导致我的 gradle 同步失败。我猜测依赖项存在冲突(因为我已经使用 firebase 为我的应用程序设置了 google 登录并且一切正常)或者加载了错误的依赖项

implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'

模块 Gradle 文件:
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28
defaultConfig {
applicationId "nus.is3261.kotlinapp"
minSdkVersion 21
targetSdkVersion 28
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 "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.shaishavgandhi:login-buttons:1.0.0'
compile 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'
}

apply plugin: 'com.google.gms.google-services'

项目 Gradle 文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.2.70'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.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
}

最佳答案

尝试更换

implementation 'com.google.firebase:firebase-database:16.0.1:15.0.0'


implementation 'com.google.firebase:firebase-database:16.0.4'

关于android - 添加 firebase 依赖项会导致 gradle 同步失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53128350/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com