19

I have problem when build my app on android studio (java)

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

in gradle-wrapper.properties i jave tried

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip

still problem exist, when create new APP i dont see this problem

classes and dependencies are updated to last versions

I tried all suggestions in this link but no help

Dreamer
  • 517
  • 1
  • 4
  • 11
  • 3
    Possible duplicate of [RegisterResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)](https://stackoverflow.com/questions/46984770/registerresgeneratingtask-is-deprecated-use-registergeneratedfoldersfilecollec) – Zoe Mar 12 '19 at 15:50
  • 2
    Problem still exist i tried every think but no solution, anyways app if working fine even with that problem – Dreamer Oct 10 '19 at 19:52
  • I think this is only a warning, Wait more time than usual. However, app is working with this warning. – Pulsara Sandeepa Mar 04 '21 at 14:38

6 Answers6

34

The issue is resolved with Google Services Plugin Version 4.3.0 (Resolved with this commit)

buildscript {
    dependencies {
        // Change version to 4.3.0
        classpath 'com.google.gms:google-services:4.3.0'
    }
}
Sarbagya Dhaubanjar
  • 1,494
  • 1
  • 8
  • 6
  • 6
    But instead it rises another issue: `WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.` https://github.com/google/play-services-plugins/issues/65 – Luten Jul 14 '19 at 13:58
14

Looks like this is solved, once and for all, without new warnings with this:

buildscript {
    dependencies {
        classpath 'com.google.gms:google-services:4.3.2'
    }
}

More info here

5

I was developing an app using Google Flutter and tried installing firebase. I was following Google's tutorial and turns out my gradle version and android studio needed an update. I was also following the google guide wrong, there's one for flutter firebase and then the other is android firebase. I went back and followed the flutter firebase guide.

So I made changes by adding the following to my project-level build.gradle

buildscript {
  dependencies {
    // Add this line
    classpath 'com.google.gms:google-services:4.3.0'
  }
}

and added this to my app-level build.gradle

// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'

Made these changes using Android Studio so I can sync all the changes throughout the app and it fixed the error.

Stanford
  • 333
  • 2
  • 10
2

In the app level build.gradle update your androidX dependencies, for me worked changing to this versions

dependencies {
    ...
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

My minSdkVersion is 19 so don't know if needed to update to 23 as suggested in by some people

jsgalarraga
  • 425
  • 6
  • 13
2

classpath 'com.google.gms:google-services:4.3.3' solves this issue.

And also it solves the issue: WARNING: API 'variant.getMergeResources()' is obsolete and has been replaced with 'variant.getMergeResourcesProvider()'.

The above issue is generated when you use classpath 'com.google.gms:google-services:4.3.0' So avoid using it.

Hassan
  • 21
  • 2
1

Last version: (on feb 2021)

classpath 'com.google.gms:google-services:4.3.5'
Cybergigz
  • 131
  • 1
  • 2