-1

我放的时候有错误

compile 'com.google.android.gms:play-services:11.0.1'

在此处输入图像描述

 apply plugin: 'com.android.application'

    android {
        compileSdkVersion 25
        buildToolsVersion "26.0.1"
        defaultConfig {
            applicationId "eyaa.compsproject"
            minSdkVersion 16
            targetSdkVersion 25
            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:25.3.1'
        compile 'com.android.support:design:25.3.1'
        compile 'com.android.support:cardview-v7:25.3.1'
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
        compile 'com.google.android.gms:play-services:11.0.1'
        compile 'com.google.firebase:firebase-core:10.0.1'
        compile 'com.google.firebase:firebase-database:10.0.1'
        testCompile 'junit:junit:4.12'
    }

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

为什么排成红色

compile 'com.android.support:appcompat-v7:25.3.1' 

使用时

 compile 'com.google.android.gms:play-services:11.0.1'
4

1 回答 1

0

播放服务和firebase版本需要相同,请替换为以下代码并检查。

compile 'com.google.android.gms:play-services:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
于 2017-09-25T13:06:33.840 回答