【发布时间】:2017-09-25 13:00:21
【问题描述】:
我放的时候出错了
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'
【问题讨论】:
-
您的 Firebase 版本需要与 Google play 匹配
-
另外,如果你只需要 GCM,那么只添加那个。您不太可能需要所有 Google Play 服务
标签: android gradle android-gradle-plugin build.gradle android-gradle-3.0