【发布时间】:2018-02-23 15:05:01
【问题描述】:
我知道这个问题被问了很多,但答案总是去你的 SDK 管理器并确保 Google Play Services 和 Google Repository 已安装/更新。
我的已更新和安装。 Google Play 服务是 44 版,Google Repository 是 58 版。另外,如果我检查 Android Studio 的更新,它会说我安装了最新版本。所以,这不是问题。谁能帮帮我?
这是我的应用 build.gradle 文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.angelakarl.flashchatnewfirebase"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.google.firebase:firebase-database:11.2.2'
compile 'com.google.firebase:firebase-auth:11.2.2'
}
apply plugin: 'com.google.gms.google-services'
这是我的另一个 build.gradle 文件
// 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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我遇到的错误是
错误:(27, 13) 无法解决:com.google.firebase:firebase-auth:11.2.2
错误:无法解决:com.google.firebase:firebase-core:11.2.2
错误:(26, 13) 无法解决:com.google.firebase:firebase-database:11.2.2
【问题讨论】:
标签: android firebase firebase-realtime-database firebase-authentication build.gradle