Gradle未编译Firebase云消息传递

Yas*_*ain 4 android gradle firebase-cloud-messaging

我注意到Firebase API已从v 9.0.0升级到v 9.0.1,因此决定更改它.

然而,它没有被注意到.

这是Gradle Logcat中的错误

   Error:(25, 13) Failed to resolve: com.google.firebase:firebase-messaging:9.0.1
   Error:(26, 13) Failed to resolve: com.google.firebase:firebase-core:9.0.1
Run Code Online (Sandbox Code Playgroud)

这是我的Gradle文件

Build.Gradle-> App

  apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"

defaultConfig {
    applicationId "com.example.lifeline.applicationgreat"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

 dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.firebase:firebase-messaging:9.0.1'
compile 'com.google.firebase:firebase-core:9.0.1'
}

apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

Build.Gradle-> Project

     // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
repositories {
    jcenter()
} 
}

 task clean(type: Delete) {
delete rootProject.buildDir 
}
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我错误或我是否遗漏任何东西.对于云消息传递,Firebase-core是否有任何要求?谢谢

小智 9

您必须更新/安装Google Repository,修订版27

检查这个答案:android上的firebase设置


小智 8

我在"com.google.firebase:firebase-ads:9.0.1"中遇到了同样的问题,我所做的是从de SDK Manager Google Repository Extra安装.