RegisterResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)

From what I can tell, plugins added as classpath dependencies will give problems. I.e. Firebase had an issue with it. Spoon and Flutter as well. Doing this Google search reveals a lot of GitHub repos with an issue raised over the same thing, and all they have in common is the fact that it's a Gradle plugin. Fabric appears to be a cause as well, as mentioned by Mate*

From what I can tell, the issue comes from a/multiple Gradle plugin (s). It can also be triggered by your Gradle code, but this is most likely not applicable if your project is an app and not a Gradle plugin.

And as mentioned by Alex Cohn in a comment, deprecation is a warning. In this case, it means it's a feature that's going to be removed eventually. So for now, assuming it is a plugin (and not made by you), you can ignore it. By the time it's removed, most/all of the major plugins should be updated to fix it.

And, again, it is a warning; not an error. You can still run it, and ignore it if there's nothing you can do about the issue. Disabling e.g. the Fabric* plugin is overkill, as it still works.

I don't use Fabric myself, and Fabric isn't open-source, so I don't know if the developers fixed it or not

TL;DR: Gradle plugins are the cause. It's a warning (not an error), so removing the plugins that cause the issue is overkill. If you can't fix it, leave it alone as long as it is only deprecated at the moment (not removed)


If you use Firebase, there is a specific solution to it that's also mentioned in the migration guide (linked later in this post); exclude the guava module

classpath ('com.google.firebase:firebase-plugins:1.1.0') {
    exclude group: 'com.google.guava', module: 'guava-jdk5'
}

The issue itself is fairly hard to detect. From what I can tell, there is no single issue that causes it in all of the plugins I checked (and linked in this answer). If you have coded something that causes the issue (and it's possible to fix it; adding a 3rd party gradle plugin isn't causing it), there are some things you can try to fix it.

From what I can tell as of the actual cause, it's solved by updating the Gradle file (though in the Spoon library, it was fixed by changing a line related to TestVariant) by following the topics in the Gradle plugin 3.0.0 migration guide.

The entire thing is covered by the developer docs, but here's some of the stuff I think is relevant based on the pull requests done on projects where it's been a problem:

Aside updating the Gradle version and plugin, you also need to add the google() repo under repositories.

compile is now implementation or api, but implementation is the recommended one.

provided is compileOnly and apk is runtimeOnly

androidTestCompile has become androidTestImplementation, and testCompile -> testImplementation

If you use flavors, you have to use flavor dimensions (covered by the docs).

For build types, you have to include fallbacks in case there is a library that doesn't have that build type. These are defined in the profile block under the android block.

If not done already, the gradle plugin has to be defined first. If you don't have any other classpath dependencies, it isn't a problem. But if you do, make sure the gradle plugin is defined first.

If you use testVariants, make sure you don't call testedVariant in the class. It appears to be the cause for the Spoon library.

These things are, from what I have been able to tell, some of the changes that were made to fix the issue.


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'
    }
}

Found here


I am using the Play services Gradle plugin com.google.gms:google-services with version 4.2.0.

In the source code we can see that: enter image description here

So for me, that was the reason of my warnings and cannot be removed until the plugin gets fixed. The issue is here

As mentioned by @Zoe, this may come from other Gradle Plugins also.


Updating to the latest version of the Fabric Gradle Plugin fixes this issue.

From the changelog:

  • Fixed “registerResGeneratingTask” deprecation warning.

https://docs.fabric.io/android/changelog.html#march-15-2018