0

I've checked this answer: https://stackoverflow.com/a/34834772/13519865

It tells us to remove this line

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

Removing the line as asked completes the build, but I can't use Firebase (ofc!), it caused a new error, which tells me to add the line: https://stackoverflow.com/a/40085096/13519865

So, I'm stuck in a loop here. Related code sample added here https://github.com/Cyberavater/A.Reader

Alex Mamo
  • 112,184
  • 14
  • 139
  • 167
Cyber Avater
  • 87
  • 2
  • 11
  • 1
    Those are some kind of old answers. Please check this [answer](https://stackoverflow.com/questions/70883309/android-studios-project-gradle-file-changed), it might help. – Alex Mamo May 13 '22 at 06:23
  • @Alex Mamo That fixes the issue thanks for your time! – Cyber Avater May 13 '22 at 07:11

1 Answers1

1

According to the new Chipmunk update of Android Studio, if you need to use Google Services, you have to add the following lines of code inside your build.gradle (Project) file:

plugins {
    id 'com.android.application' version '7.2.0' apply false
    id 'com.android.library' version '7.2.0' apply false
    id 'com.google.gms.google-services' version '4.3.10' apply false 
}

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

And inside your build.gradle (Module) file, the following plugin IDs:

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services' 
}
Alex Mamo
  • 112,184
  • 14
  • 139
  • 167
  • Hello, it seems the is a problem still holds. When I used version 4.3.0 following here https://stackoverflow.com/questions/70883309/android-studios-project-gradle-file-changed it was working, but using version 4.3.10 am having the same issue. – Cyber Avater May 13 '22 at 12:58
  • Execution failed for task ':app:mapDebugSourceSetPaths'. > Error while evaluating property 'extraGeneratedResDir' of task ':app:mapDebugSourceSetPaths' Caused by: org.gradle.api.InvalidUserCodeException: Querying the mapped value of provider(interface java.util.Set) before task ':app:processDebugGoogleServices' has completed is not supported – Cyber Avater May 13 '22 at 12:58
  • 1
    Try to use the latest `7.2.0` for Gradle or downgrade it to `4.3.0`. – Alex Mamo May 13 '22 at 13:00
  • Yes, you are right, Changing it to "7.2.0" worked, Thanks! but isn't '7.4.0-alpha01' more latest? (already latest as it was already '7.4.0-alpha01' by default). – Cyber Avater May 13 '22 at 13:32
  • Yes, but I prefer to work with stable versions. It's up to you to decide if you want to use that one, or not. – Alex Mamo May 13 '22 at 13:48