Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle not compiling for Firebase Cloud Messaging

I noticed that Firebase APIs have upgraded from v 9.0.0 to v 9.0.1 and so decided to change that.

However it is not getting noticed.

Here is the Error in 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

And here are my Gradle Files

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'

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 
}

Can Anyone tell whats the Error or if I am Missing anything. Also Is there any requirement of Firebase-core for Cloud Messaging? Thanks

like image 588
Yash Jain Avatar asked Dec 01 '22 13:12

Yash Jain


2 Answers

You have to update/install Google Repository, revision 27

Check this answer: firebase setup on android

like image 155
kleiser sarifo Avatar answered Dec 15 '22 15:12

kleiser sarifo


I had the same issue with "com.google.firebase:firebase-ads:9.0.1", what I did was install from de SDK Manager Google Repository Extra.

like image 29
Franklin Avatar answered Dec 15 '22 16:12

Franklin