Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android firebase在gradle中添加依赖项时显示错误_Android_Gradle_Dependencies - Fatal编程技术网

android firebase在gradle中添加依赖项时显示错误

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

添加依赖项后出错:

这是我的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.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()