7

When I read this doc: https://developers.google.com/android/guides/google-services-plugin they say :

As part of enabling Google APIs or Firebase services in your Android application you may have to add the google-services plugin to your build.gradle file:

dependencies {
    classpath 'com.google.gms:google-services:4.3.14'
    // ...
}

then they say also :

Add dependencies for basic libraries required for the services you have enabled. This step requires that you apply the Google Services Gradle plugin in your app/build.gradle file, like so: apply plugin: 'com.google.gms.google-services'

so i start a blank new android project in the very last version of android studio and I have for the root build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.3.1' apply false
    id 'com.android.library' version '7.3.1' apply false
}

and in app/build.gradle:

plugins {
    id 'com.android.application'
}

android {
    namespace 'app.dependencieswalker'
    compileSdk 32

    defaultConfig {
        applicationId "app.dependencieswalker"
        minSdk 21
        targetSdk 32
        versionCode 1
        versionName "1.0"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
        implementation "com.alcinoe:alcinoe-firebase:1.0.0"
}

so where I must add the

dependencies {
    classpath 'com.google.gms:google-services:4.3.14'
    // ...
}

and

apply plugin: 'com.google.gms.google-services' ?
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841
zeus
  • 12,173
  • 9
  • 63
  • 184
  • Have you seen this [answer](https://stackoverflow.com/questions/72224454/execution-failed-for-task-appmapdebugsourcesetpaths-error-while-evaluatin/72226009#72226009)? Does it help? – Alex Mamo Nov 23 '22 at 15:23

1 Answers1

15

In your root build.gradle file in the plugins block add

plugins {
    //....
    id 'com.google.gms.google-services' version '4.3.14' apply false
}

Then apply it in the module build.gradle file with:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}
Gabriele Mariotti
  • 320,139
  • 94
  • 887
  • 841