android firebase在gradle中添加依赖项时显示错误
添加依赖项后出错: 这是我的build.gradle应用程序代码,我在其中添加了compile'com.google.firebase:firebase-core:11.6.0' 编译'com.google.firebase:firebase数据库:11.6.0'依赖项。下面对其进行了注释android firebase在gradle中添加依赖项时显示错误,android,gradle,dependencies,Android,Gradle,Dependencies,添加依赖项后出错: 这是我的build.gradle应用程序代码,我在其中添加了compile'com.google.firebase:firebase-core:11.6.0' 编译'com.google.firebase:firebase数据库:11.6.0'依赖项。下面对其进行了注释 apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion "26.0
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.thelost.fisp_beta10"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
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.android.support:appcompat-v7:26.+'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'com.android.support:design:26.+'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//for the firebase
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
}
//for the firebase
apply plugin: 'com.google.gms.google-services'
在根
build.gradle
文件中添加回购:
allprojects {
repositories {
// ...
maven { url "https://maven.google.com" }
}
}
如果您使用的是gradle4.0
或更高版本,则可以替换maven{url“https://maven.google.com“}
只需google()