0

Trying to connect Firebase to project and got this error

Error:Execution failed for task ':app:processDebugGoogleServices'.

No matching client found for package name 'com.google.firebase.udacity.friendlychat'

My gradle project

buildscript {
    repositories {
        jcenter()
        mavenLocal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'

    }
}

allprojects {
    repositories {
        jcenter()
        mavenLocal()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Gradle APP

apply plugin: 'com.android.application'

repositories {
    mavenLocal()
    flatDir {
        dirs 'libs'
    }
}

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.google.firebase.udacity.friendlychat"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:design:24.2.0'
    compile 'com.android.support:appcompat-v7:24.2.0'

    compile 'com.github.bumptech.glide:glide:3.6.1'
}

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

I have adde google-services.json in APP folder. And like 4 monthes ago everything worked well. But now it doesn't.

P.S. I tried some solutions already from first page google -> stack = no results. If you want to make -1 please make a note and I will improve my skill in working with stackoverflow.

Thank you

Boris Ruzanov
  • 105
  • 1
  • 10

2 Answers2

2

Download google-services.json again. that might be changed somehow.

Pratim P
  • 169
  • 1
  • 5
0

You are trying to connect to Firebase but you don't have a dependencies of Firebase at all. If you want to use Firebase Realtime Database and Firebase Cloud Messaging as I see in your tags, please add in your build.gradle file, the following lines of code:

com.google.firebase:firebase-database:11.8.0
com.google.firebase:firebase-messaging:11.8.0

If you want other services, see how to Add Firebase to Your Android Project.

Don't forget to redownload the google-services.json file.

Alex Mamo
  • 130,605
  • 17
  • 163
  • 193