我经常遇到这个问题。 Android Studio无法解析 11.2.0 Firebase 的最新版本。
这是我的根级gradle,
/* Top-level build file where you can add configuration options common to all sub-projects/modules.*/
buildscript {
repositories {
jcenter{
url 'http://jcenter.bintray.com'
}
}
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()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app gradle是,
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.cognisun.fcmdemo"
minSdkVersion 23
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 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.+'
compile 'com.google.android.gms:play-services:11.2.0'
compile 'com.google.firebase:firebase-core:11.2.0'
}
apply plugin: 'com.google.gms.google-services'
我已经下载了所有必备的sdk文件,并且还遵循了this链接。
甚至为什么我做错了。 任何建议人